gpsd-dev
[Top][All Lists]
Advanced

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

[gpsd-dev] [PATCH] Tidy maskaudit.py -dt output by quoting grep input.


From: Rob Norris
Subject: [gpsd-dev] [PATCH] Tidy maskaudit.py -dt output by quoting grep input.
Date: Mon, 9 May 2016 21:31:05 +0100

Otherwise get things like:
sh: 1: Syntax error: "(" unexpected (expecting "}")
when processing INTERNAL_SET(n)
---
 maskaudit.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/maskaudit.py b/maskaudit.py
index 4805809..32497e6 100755
--- a/maskaudit.py
+++ b/maskaudit.py
@@ -45,11 +45,11 @@ class SourceExtractor(object):
                     self.primitive_masks.append((fields[1], fields[2]))
 
     def in_library(self, flag):
-        (status, _output) = getstatusoutput("grep %s libgps_core.c 
libgps_json.c gpsctl.c" % flag)
+        (status, _output) = getstatusoutput("grep '%s' libgps_core.c 
libgps_json.c gpsctl.c" % flag)
         return status == 0
 
     def in_daemon(self, flag):
-        (status, _output) = getstatusoutput("grep %s %s" % (flag, " 
".join(self.daemonfiles)))
+        (status, _output) = getstatusoutput("grep '%s' %s" % (flag, " 
".join(self.daemonfiles)))
         return status == 0
 
     def relevant(self, flag):
-- 
2.8.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]