From 4a7d41f58846d8a040c9c8f5b4aa2207be2097ce Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Mon, 1 Aug 2011 13:02:18 +0200 Subject: Fix small bug with filenames that contain commas. When tokenizing the "diffstat -t" output, commas inside the filename shouldn't be considered. We achive it by splitting only on the first three commas. --- patchtracker/Patch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patchtracker/Patch.py b/patchtracker/Patch.py index 80ad8dc..6a97754 100644 --- a/patchtracker/Patch.py +++ b/patchtracker/Patch.py @@ -22,7 +22,7 @@ class Diffstat: copyfileobj(patch_fh, popen.stdin) popen.stdin.close() popen.stdout.readline() - self._stats = map(lambda x: map(lambda y: y.strip(), x.split(',')), popen.stdout.readlines()) + self._stats = map(lambda x: map(lambda y: y.strip(), x.split(',', 3)), popen.stdout.readlines()) popen.wait() def stats(self): @@ -31,7 +31,7 @@ class Diffstat: i.write(str(self.patch)) i.close() o.readline() - return [map(lambda x: x.strip(), l.split(",")) for l in o.readlines()] + return [map(lambda x: x.strip(), l.split(",", 3)) for l in o.readlines()] else: return self._stats -- cgit v1.2.3