diff --git a/src/registry.py b/src/registry.py index 569b3924f..5ceafad3b 100644 --- a/src/registry.py +++ b/src/registry.py @@ -68,13 +68,18 @@ def open(filename, clear=False): _fd = file(filename) fd = utils.file.nonCommentNonEmptyLines(_fd) acc = '' + slashEnd = re.compile(r'\\*$') for line in fd: line = line.rstrip('\r\n') # XXX There should be some way to determine whether or not we're # starting a new variable or not. As it is, if there's a backslash # at the end of every line in a variable, it won't be read, and # worse, the error will pass silently. - if line.endswith('\\'): + # + # If the line ends in an odd number of backslashes, then there is a + # line-continutation. + m = slashEnd.search(line) + if m and len(m.group(0)) % 2: acc += line[:-1] continue else: @@ -82,7 +87,7 @@ def open(filename, clear=False): try: (key, value) = re.split(r'(?