]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
dispatch_call_to_sessions: skip envs without name
authorDaniel Hahler <git@thequod.de>
Mon, 20 Nov 2017 04:22:57 +0000 (05:22 +0100)
committerDaniel Hahler <git@thequod.de>
Mon, 20 Nov 2017 21:24:45 +0000 (22:24 +0100)
Fixes https://github.com/phillipberndt/autorandr/issues/87.

autorandr.py

index ca35ba93a80225e1e1ed1667497d02d443b79dba..abf11980ca36be22b9ece76b64d569559120ede8 100755 (executable)
@@ -957,8 +957,8 @@ def dispatch_call_to_sessions(argv):
 
         process_environ = {}
         for environ_entry in open(environ_file).read().split("\0"):
-            if "=" in environ_entry:
-                name, value = environ_entry.split("=", 1)
+            name, sep, value = environ_entry.partition("=")
+            if name and sep:
                 if name == "DISPLAY" and "." in value:
                     value = value[:value.find(".")]
                 process_environ[name] = value