Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
regenerate the parser files with flexml 1.9.3 (thx agier for the patch)
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 5 Jul 2012 15:01:25 +0000 (17:01 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 5 Jul 2012 15:01:48 +0000 (17:01 +0200)
src/simdag/dax_dtd.c
src/surf/simgrid_dtd.c
src/xbt/graphxml.c

index f0eae81..29c6072 100644 (file)
@@ -1498,13 +1498,24 @@ static int ck_ilimit()
 #ifdef FLEXML_NEED_BUFFERLIT
 static void dax__bufferliteral(char c, int* pp, const char* text)
 {
-  const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c);
-  assert(s <= e); BUFFERSET(*pp);
-  while (++s<e) {
-    if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
-    else BUFFERPUTC(*s);
-  }
-  BUFFERDONE;
+   BUFFERSET(*pp);
+   if (c) {
+      const char *s = strchr(text, c), *e = strrchr(text, c);
+      assert(s && e && s <= e);
+      ++s;
+      while (s < e) {
+        if (isspace(*s)) {
+           BUFFERPUTC(' ');
+           do ++s; while (s < e && isspace(*s));
+        } else
+          BUFFERPUTC(*s++);
+      }
+   } else {
+      const char *s = text;
+      while (*s)
+       BUFFERPUTC(*s++);
+   }
+   BUFFERDONE;
 }
 #endif
 
index 2cba713..94741bc 100644 (file)
@@ -4586,13 +4586,24 @@ static int ck_ilimit()
 #ifdef FLEXML_NEED_BUFFERLIT
 static void surfxml_bufferliteral(char c, int* pp, const char* text)
 {
-  const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c);
-  assert(s <= e); BUFFERSET(*pp);
-  while (++s<e) {
-    if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
-    else BUFFERPUTC(*s);
-  }
-  BUFFERDONE;
+   BUFFERSET(*pp);
+   if (c) {
+      const char *s = strchr(text, c), *e = strrchr(text, c);
+      assert(s && e && s <= e);
+      ++s;
+      while (s < e) {
+        if (isspace(*s)) {
+           BUFFERPUTC(' ');
+           do ++s; while (s < e && isspace(*s));
+        } else
+          BUFFERPUTC(*s++);
+      }
+   } else {
+      const char *s = text;
+      while (*s)
+       BUFFERPUTC(*s++);
+   }
+   BUFFERDONE;
 }
 #endif
 
index c3353c3..905fc9e 100644 (file)
@@ -1257,13 +1257,24 @@ static int ck_ilimit()
 #ifdef FLEXML_NEED_BUFFERLIT
 static void graphxml_bufferliteral(char c, int* pp, const char* text)
 {
-  const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c);
-  assert(s <= e); BUFFERSET(*pp);
-  while (++s<e) {
-    if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
-    else BUFFERPUTC(*s);
-  }
-  BUFFERDONE;
+   BUFFERSET(*pp);
+   if (c) {
+      const char *s = strchr(text, c), *e = strrchr(text, c);
+      assert(s && e && s <= e);
+      ++s;
+      while (s < e) {
+        if (isspace(*s)) {
+           BUFFERPUTC(' ');
+           do ++s; while (s < e && isspace(*s));
+        } else
+          BUFFERPUTC(*s++);
+      }
+   } else {
+      const char *s = text;
+      while (*s)
+       BUFFERPUTC(*s++);
+   }
+   BUFFERDONE;
 }
 #endif