r2302 - alfs-POC/src

jhuntwork at linuxfromscratch.org jhuntwork at linuxfromscratch.org
Mon Mar 6 09:06:08 PST 2006


Author: jhuntwork
Date: 2006-03-06 10:06:07 -0700 (Mon, 06 Mar 2006)
New Revision: 2302

Modified:
   alfs-POC/src/parser.cpp
Log:
Don't parse comments

Modified: alfs-POC/src/parser.cpp
===================================================================
--- alfs-POC/src/parser.cpp	2006-03-06 16:49:35 UTC (rev 2301)
+++ alfs-POC/src/parser.cpp	2006-03-06 17:06:07 UTC (rev 2302)
@@ -24,7 +24,7 @@
 
 int parse_file(string filename){
 
-  int loc, len, i, multi = 0;
+  int loc, len, i, multi = 0, comment = 0;
   string fn, parent, curline, path, buf, multibuf, parsebuf;
   const char *dir, *file;
   char wd[256];
@@ -66,6 +66,18 @@
     if (curline.empty())
       continue;
 
+    if (comment == 1) {
+	if ((curline.find("-->", 0)) == string::npos)
+ 	  continue;
+	comment = 0;
+	continue;
+    }
+
+    if ((curline.find("<!--", 0)) != string::npos) {
+	comment = 1;
+	continue;
+    }
+
     for (buf = string(curline); !buf.empty(); i = 0) {
 	if (multi != 1)
 	  i = buf.find_first_of("<");




More information about the alfs-log mailing list