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

From: Jakub Narebski <[email-masked]>
Date: Fri, 19 Jan 2007 13:10:31 +0100

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