]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: parser: Correctly generate colorpixels from hex codes
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 1 Oct 2009 10:29:27 +0000 (12:29 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 1 Oct 2009 10:29:27 +0000 (12:29 +0200)
src/cfgparse.y

index 8a3584540bf043febf73c5da7e14ef673810dd74..4cb82998a15e6e45441ac71610bbb6911245acc2 100644 (file)
@@ -493,7 +493,14 @@ color:
         ;
 
 colorpixel:
-        '#' HEX         { $<number>$ = get_colorpixel(global_conn, $<string>2); }
+        '#' HEX
+        {
+                char *hex;
+                if (asprintf(&hex, "#%s", $<string>2) == -1)
+                        die("asprintf()");
+                $<number>$ = get_colorpixel(global_conn, hex);
+                free(hex);
+        }
         ;