[damned-lies] Strip only last backslash in string (Bug #580104)



commit cb5d15d0856fa8bbd540a048eb7091959cd57098
Author: Claude Paroz <claude 2xlibre net>
Date:   Fri Apr 24 14:41:22 2009 +0200

    Strip only last backslash in string (Bug #580104)
    
    Newlines has already been stripped by strip(), so this was removing
    one extra character. Seems this didn't strike us before because people
    generally precede the backslash with a space...
---
 stats/utils.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/stats/utils.py b/stats/utils.py
index bd953ac..84d1c07 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -153,8 +153,8 @@ def read_makefile_variable(vcs_path, variable):
     fullline = ""
     for line in fin:
         fullline += " " + line.strip()
-        if len(line)>2 and line[-2] == "\\":
-            fullline = fullline[:-2]
+        if len(line)>2 and fullline[-1] == "\\":
+            fullline = fullline[:-1]
         else:
             match = re.match(variable + r"\s*=\s*([^=]*)", fullline.strip())
             if match:



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