Changeset 335


Ignore:
Timestamp:
Sep 11, 2006, 1:09:47 AM (19 years ago)
Author:
pr
Message:

Allow EOL to terminate non-quoted attributes

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1-0/src/helpers/stringh.c

    r332 r335  
    12731273 *
    12741274 *@@added V0.9.0 [umoeller]
     1275 *@@changed V1.0.13 (2006-09-10) [pr]: improved parsing
    12751276 */
    12761277
     
    12891290        // determine end character to search for: a space
    12901291        CHAR cEnd = ' ';
    1291         if (*pParam == '\"')
    1292         {
    1293             // or, if the data is enclosed in quotes, a quote
    1294             cEnd = '\"';
    1295             pParam++;
    1296         }
    1297 
    12981292        // V1.0.3 (2004-11-10) [pr]: @@fixes 461
    1299         if (*pParam == '\'')
    1300         {
    1301             // or, if the data is enclosed in single quotes, a single quote
    1302             cEnd = '\'';
     1293        // V1.0.13 (2006-09-10) [pr]: optimized
     1294        if ((*pParam == '\"') || (*pParam == '\''))
     1295        {
     1296            // or, if the data is enclosed in quotes, a quote or single quote
     1297            cEnd = *pParam;
    13031298            pParam++;
    13041299        }
     
    13121307        while (*pParam)
    13131308        {
    1314             if (*pParam == cEnd)
     1309            // V1.0.13 (2006-09-10) [pr]: line end terminates non-quoted attribute
     1310            if (   (   (cEnd == ' ')
     1311                    && ((*pParam == ' ') || (*pParam == '\r') || (*pParam == '\n')))
     1312                || (*pParam == cEnd)
     1313               )
    13151314                // end character found
    13161315                break;
  • trunk/src/helpers/stringh.c

    r332 r335  
    14471447 *
    14481448 *@@added V0.9.0 [umoeller]
     1449 *@@changed V1.0.13 (2006-09-10) [pr]: improved parsing
    14491450 */
    14501451
     
    14631464        // determine end character to search for: a space
    14641465        CHAR cEnd = ' ';
    1465         if (*pParam == '\"')
    1466         {
    1467             // or, if the data is enclosed in quotes, a quote
    1468             cEnd = '\"';
    1469             pParam++;
    1470         }
    1471 
    14721466        // V1.0.3 (2004-11-10) [pr]: @@fixes 461
    1473         if (*pParam == '\'')
    1474         {
    1475             // or, if the data is enclosed in single quotes, a single quote
    1476             cEnd = '\'';
     1467        // V1.0.13 (2006-09-10) [pr]: optimized
     1468        if ((*pParam == '\"') || (*pParam == '\''))
     1469        {
     1470            // or, if the data is enclosed in quotes, a quote or single quote
     1471            cEnd = *pParam;
    14771472            pParam++;
    14781473        }
     
    14861481        while (*pParam)
    14871482        {
    1488             if (*pParam == cEnd)
     1483            // V1.0.13 (2006-09-10) [pr]: line end terminates non-quoted attribute
     1484            if (   (   (cEnd == ' ')
     1485                    && ((*pParam == ' ') || (*pParam == '\r') || (*pParam == '\n')))
     1486                || (*pParam == cEnd)
     1487               )
    14891488                // end character found
    14901489                break;
Note: See TracChangeset for help on using the changeset viewer.