[ekg2-commit] r4027 - trunk/ekg: trunk/ekg/configfile.c

SVN commit svn w toxygen.net
Pon, 23 Cze 2008, 15:39:20 CEST


Author: darkjames
Date: 2008-06-23 15:39:20 +0200 (Mon, 23 Jun 2008)
New Revision: 4027

Modified:
   trunk/ekg/configfile.c
Log:
restore strip_quotes() currently it won't work without it. sorry.
don't use it.



Modified: trunk/ekg/configfile.c
===================================================================
--- trunk/ekg/configfile.c	2008-06-23 13:34:39 UTC (rev 4026)
+++ trunk/ekg/configfile.c	2008-06-23 13:39:20 UTC (rev 4027)
@@ -68,6 +68,22 @@
         }
 
 
+static char *strip_quotes(char *line) {
+	size_t linelen;
+	char *buf;
+
+	if (!(linelen = xstrlen(line))) return line;
+
+	for (buf = line; *buf == '\"'; buf++);
+
+	while (linelen > 0 && line[linelen - 1] == '\"') {
+		line[linelen - 1] = 0;
+		linelen--;
+	}
+
+	return buf;
+}
+
 /* 
  * config_postread()
  *
@@ -76,7 +92,7 @@
 void config_postread()
 {
         if (config_windows_save && config_windows_layout) {
-                char **targets = array_make(config_windows_layout, "|", 0, 0, 1);
+                char **targets = array_make(config_windows_layout, "|", 0, 0, 0);
                 int i;
 
                 for (i = 1; targets[i]; i++) {
@@ -96,6 +112,7 @@
 
 		                tmp++;
 				tmp = strip_spaces(tmp);
+				tmp = strip_quotes(tmp);
 
 				window_new(tmp, s, i + 1);	
 	



Więcej informacji o liście dyskusyjnej ekg2-commit