]> granicus.if.org Git - libexpat/commitdiff
Require whitespace between attribute name and following attribute value
authorJames Clark <jjc@jclark.com>
Sat, 23 May 1998 07:27:59 +0000 (07:27 +0000)
committerJames Clark <jjc@jclark.com>
Sat, 23 May 1998 07:27:59 +0000 (07:27 +0000)
expat/xmltok/xmltok_impl.c

index cc64e9596a8dff69179d51e28549ede9bd0854a8..4f8383259df259fe89b911a277a4f79ce8764feb 100755 (executable)
@@ -606,6 +606,22 @@ int PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
            break;
          }
        }
+       ptr += MINBPC;
+       if (ptr == end)
+         return XML_TOK_PARTIAL;
+       switch (BYTE_TYPE(enc, ptr)) {
+       case BT_S:
+       case BT_CR:
+       case BT_LF:
+         break;
+       case BT_SOL:
+         goto sol;
+       case BT_GT:
+         goto gt;
+       default:
+         *nextTokPtr = ptr;
+         return XML_TOK_INVALID;
+       }
        /* ptr points to closing quote */
        for (;;) {
          ptr += MINBPC;
@@ -616,9 +632,11 @@ int PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
          case BT_S: case BT_CR: case BT_LF:
            continue;
          case BT_GT:
+          gt:
            *nextTokPtr = ptr + MINBPC;
            return XML_TOK_START_TAG_WITH_ATTS;
          case BT_SOL:
+          sol:
            ptr += MINBPC;
            if (ptr == end)
              return XML_TOK_PARTIAL;