Re: [RFC] Git config file reader in Perl (WIP)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jakub Narebski wrote:
> Jakub Narebski wrote:
> 
>> BTW. it looks like C escape sequences are parsed, but not octal
>> escape sequences, nor no-op escaping other character.
>  
> From a bit of testing, as documentation of config file format
> is woefully incomplete, (yes, I know I should use the source)
> _some_ of C escape sequences aka. character escape codes (CEC)
> are parsed:
>  - "\t", tab character (HT, TAB)
>  - "\n", newline (NL)
>  - "\b", backspace (BS)
> It's a bit strange that "\b" is parsed...
[...]
> Values of configuration variables can span multiple lines by escaping
> newline, i.e. putting \ as the last character. Nice.

>From config.c:parse_value:73

		if (c == '\\') {
			c = get_next_char();
			switch (c) {
			case '\n':
				continue;
			case 't':
				c = '\t';
				break;
			case 'b':
				c = '\b';
				break;
			case 'n':
				c = '\n';
				break;
			/* Some characters escape as themselves */
			case '\\': case '"':
				break;
			/* Reject unknown escape sequences */
			default:
				return NULL;
			}

-- 
Jakub Narebski
Poland
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]