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

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

 



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...

Other CEC cause "fatal: bad config file line 41 <nn> in <file>"
error:
 - "\r", return (CR)
 - "\f", form feed (FF)
 - "\a", alarm (bell) (BEL)
 - "\e", escape (ESC)
 - "\v", vertical tab (VT)
I think supporting "\e" could be useful, but also dangerous.

Octal char sequences (like \040 or \0 for NUL) are not supported
and result in "bad config file" error.

Literal/unknown escape sequences like "\w" or "\." also result
in "bad config file" error, with the obvious exception of escaping
quote character i.e. \" and escaping escape character i.e. \\

Values of configuration variables can span multiple lines by escaping
newline, i.e. putting \ as the last character. Nice. (This doesn't work
for comments, of course). This doesn't work for section headers nor key 
names.

-- 
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]