chiark / gitweb /
extract-profile.in: Property name fixup wasn't applied to ${...} tokens.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 25 Dec 2011 23:58:43 +0000 (23:58 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 26 Dec 2011 00:08:44 +0000 (00:08 +0000)
Move it into the common replacement code.

extract-profile.in

index c3a224b09bfbe60ea8f73ae30ae9466ac89e892b..dc816f36f02bb0085dd7b8e792832a5176920daa 100755 (executable)
@@ -279,7 +279,7 @@ class Section (object, UD.DictMixin):
         left = dol + 1
         while left < n and (string[left].isalnum() or string[left] in '-_'):
           left += 1
         left = dol + 1
         while left < n and (string[left].isalnum() or string[left] in '-_'):
           left += 1
-        prop = string[dol + 1:left].replace('-', '_')
+        prop = string[dol + 1:left]
 
       ## If we came up empty, report an error.
       if prop == '':
 
       ## If we came up empty, report an error.
       if prop == '':
@@ -287,6 +287,7 @@ class Section (object, UD.DictMixin):
               "invalid placeholder (empty name) in `%s'" % string
 
       ## Extend the path: we're going to do a recursive expansion.
               "invalid placeholder (empty name) in `%s'" % string
 
       ## Extend the path: we're going to do a recursive expansion.
+      prop = prop.replace('-', '_')
       path.append(prop)
 
       ## Report a cycle if we found one.
       path.append(prop)
 
       ## Report a cycle if we found one.