Ignore:
Timestamp:
Sep 1, 2010, 12:03:15 PM (9 years ago)
Author:
cameron
Message:

Ensure PI name check does not report error for valid XML declaration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/template.c

    r591 r596  
    163163
    164164static inline int PIName_check(int pos) {
    165         int block_pos = block_base + pos;         
     165        int block_pos = block_base + pos;
     166        int file_pos = block_pos+buffer_base; 
    166167        if (at_XxMmLll<ASCII>((unsigned char*)&source[block_pos]) && (source[block_pos+3]=='?' || source[block_pos+3]<= ' ')) {
    167               fprintf(stderr, "[Xx][Mm][Ll] illegal as PI name at position %i\n",block_pos+buffer_base);
     168              // "<?xml" legal at start of file.
     169              if ((file_pos == 2) && at_XmlDecl_start<ASCII>((unsigned char*)&source[0])) return 0;
     170              fprintf(stderr, "[Xx][Mm][Ll] illegal as PI name at position %i\n",file_pos);
    168171              exit(-1);
    169172        }
Note: See TracChangeset for help on using the changeset viewer.