diff gui/util/string.c @ 33073:334e19411421

Improve handling of the comment character. The comment character is safe now between (double) quotation marks. This simplifies handling in the font description file and allows it to be used in label texts.
author ib
date Wed, 30 Mar 2011 14:24:11 +0000
parents 956c67bb5198
children 60b2e408bd78
line wrap: on
line diff
--- a/gui/util/string.c	Wed Mar 30 13:47:33 2011 +0000
+++ b/gui/util/string.c	Wed Mar 30 14:24:11 2011 +0000
@@ -67,3 +67,25 @@
 
     return in;
 }
+
+char *decomment(char *in)
+{
+    char *p;
+    int nap = 0;
+
+    p = in;
+
+    while (*p) {
+        if (*p == '"')
+            nap = !nap;
+
+        if ((*p == ';') && !nap) {
+            *p = 0;
+            break;
+        }
+
+        p++;
+    }
+
+    return in;
+}