[gnome-lirc-properties] Don't be overly enthusiastic when shell-quoting



commit 1f4673de56facbefbed6adb9465c358fbe93b0bc
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jun 30 12:52:37 2009 +0100

    Don't be overly enthusiastic when shell-quoting
    
    2009-06-30  Bastien Nocera  <hadess hadess net>
    
    	* gnome_lirc_properties/backend.py: Don't be overly
    	enthusiastic when shell-quoting into the lirc configuration
    	file, empty strings (not none) would quoted as "''"

 ChangeLog                        |    6 ++++++
 gnome_lirc_properties/backend.py |   10 ++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 124ce73..41934e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-06-30  Bastien Nocera  <hadess hadess net>
 
+	* gnome_lirc_properties/backend.py: Don't be overly
+	enthusiastic when shell-quoting into the lirc configuration
+	file, empty strings (not none) would quoted as "''"
+
+2009-06-30  Bastien Nocera  <hadess hadess net>
+
 	* data/receivers.conf: Remove Snapstream definition, the
 	remote driver has been merged into the kernel since 2006
 	(Closes: #557429)
diff --git a/gnome_lirc_properties/backend.py b/gnome_lirc_properties/backend.py
index aee73be..881b7df 100644
--- a/gnome_lirc_properties/backend.py
+++ b/gnome_lirc_properties/backend.py
@@ -580,7 +580,10 @@ class BackendService(PolicyKitService):
 
             if value is not None:
                 logging.info('- writing %s"%s"', match.group(0), value)
-                print >> output, ('%s"%s"' % (match.group(0), ShellQuote.shellquote(value)))
+		if value == "":
+                    print >> output, ('%s"%s"' % (match.group(0), value))
+                else:
+                    print >> output, ('%s"%s"' % (match.group(0), ShellQuote.shellquote(value)))
                 continue
 
             # Identify directives starting with RECEIVER_ and replacing their values with ours.
@@ -590,7 +593,10 @@ class BackendService(PolicyKitService):
 
             if value is not None:
                 logging.info('- writing %s"%s"', match.group(0), value)
-                print >> output, ('%s"%s"' % (match.group(0), ShellQuote.shellquote(value)))
+		if value == "":
+                    print >> output, ('%s"%s"' % (match.group(0), value))
+	        else:
+                    print >> output, ('%s"%s"' % (match.group(0), ShellQuote.shellquote(value)))
                 continue
 
             # Deal with the START_LIRCD line:



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