[Kst] kdeextragear-2/kst/kst/datasources/dirfile

Barth Netterfield netterfield at astro.utoronto.ca
Mon Nov 8 20:16:58 CET 2004


CVS commit by netterfield: 

BUG:

Adding optional parameters in BIT fields means that comments at the end of 
lines are no longer automatically ignored in the format file.  This patch 
detects comments and truncates them away before the parser ever sees them.


  M +9 -1      getdata.c   1.22


--- kdeextragear-2/kst/kst/datasources/dirfile/getdata.c  #1.21:1.22
@@ -61,4 +61,5 @@ static int GetLine(FILE *fp, char *line)
   char *ret_val;
   int first_char;
+  int i, len;
 
   do {
@@ -69,5 +70,12 @@ static int GetLine(FILE *fp, char *line)
   } while (((line[0] =='#') || (strlen(line)<2)) && (ret_val!=NULL));
 
+  
   if (ret_val!=NULL) {
+    /* truncate comments from end of lines */
+    len = strlen(line);
+    for (i=0; i<len; i++) {
+      if (line[i]=='#') line[i] = '\0';
+    }
+    
     return (1); /* a line was read */
   } else {





More information about the Kst mailing list