Fossil SCM
Remove all use of ctypes.h in order to avoid compiler warnings and other problems associated with changing locales.
Commit
2fac809165bbb203b22e1765aca647f936c20595
Parent
62f8acbe731dfe4…
26 files changed
+1
-1
+3
-3
+26
-9
+17
-15
+4
-4
+3
-3
+1
-1
+1
-1
+1
-1
+2
-2
+2
-2
+2
-2
+2
-2
+1
-1
+1
-1
+2
-2
+10
-10
+16
-16
+2
-2
+3
-3
+5
-5
+1
-1
+2
-2
+2
-2
+2
-2
+28
-28
~
src/allrepo.c
~
src/attach.c
~
src/blob.c
~
src/cgi.c
~
src/checkin.c
~
src/comformat.c
~
src/config.h
~
src/diff.c
~
src/doc.c
~
src/encode.c
~
src/event.c
~
src/http.c
~
src/http_transport.c
~
src/login.c
~
src/main.c
~
src/manifest.c
~
src/name.c
~
src/report.c
~
src/search.c
~
src/th_main.c
~
src/timeline.c
~
src/tkt.c
~
src/url.c
~
src/user.c
~
src/wiki.c
~
src/wikiformat.c
+1
-1
| --- src/allrepo.c | ||
| +++ src/allrepo.c | ||
| @@ -34,11 +34,11 @@ | ||
| 34 | 34 | static char *quoteFilename(const char *zFilename){ |
| 35 | 35 | int i, c; |
| 36 | 36 | int needQuote = 0; |
| 37 | 37 | for(i=0; (c = zFilename[i])!=0; i++){ |
| 38 | 38 | if( c=='"' ) return 0; |
| 39 | - if( isspace(c) ) needQuote = 1; | |
| 39 | + if( fossil_isspace(c) ) needQuote = 1; | |
| 40 | 40 | if( c=='\\' && zFilename[i+1]==0 ) return 0; |
| 41 | 41 | if( c=='$' ) return 0; |
| 42 | 42 | } |
| 43 | 43 | if( needQuote ){ |
| 44 | 44 | return mprintf("\"%s\"", zFilename); |
| 45 | 45 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -34,11 +34,11 @@ | |
| 34 | static char *quoteFilename(const char *zFilename){ |
| 35 | int i, c; |
| 36 | int needQuote = 0; |
| 37 | for(i=0; (c = zFilename[i])!=0; i++){ |
| 38 | if( c=='"' ) return 0; |
| 39 | if( isspace(c) ) needQuote = 1; |
| 40 | if( c=='\\' && zFilename[i+1]==0 ) return 0; |
| 41 | if( c=='$' ) return 0; |
| 42 | } |
| 43 | if( needQuote ){ |
| 44 | return mprintf("\"%s\"", zFilename); |
| 45 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -34,11 +34,11 @@ | |
| 34 | static char *quoteFilename(const char *zFilename){ |
| 35 | int i, c; |
| 36 | int needQuote = 0; |
| 37 | for(i=0; (c = zFilename[i])!=0; i++){ |
| 38 | if( c=='"' ) return 0; |
| 39 | if( fossil_isspace(c) ) needQuote = 1; |
| 40 | if( c=='\\' && zFilename[i+1]==0 ) return 0; |
| 41 | if( c=='$' ) return 0; |
| 42 | } |
| 43 | if( needQuote ){ |
| 44 | return mprintf("\"%s\"", zFilename); |
| 45 |
+3
-3
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -82,11 +82,11 @@ | ||
| 82 | 82 | zUrlTail = mprintf("page=%t&file=%t", zTarget, zFilename); |
| 83 | 83 | } |
| 84 | 84 | @ |
| 85 | 85 | @ <p><a href="/attachview?%s(zUrlTail)">%h(zFilename)</a> |
| 86 | 86 | @ [<a href="/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]<br /> |
| 87 | - if( zComment ) while( isspace(zComment[0]) ) zComment++; | |
| 87 | + if( zComment ) while( fossil_isspace(zComment[0]) ) zComment++; | |
| 88 | 88 | if( zComment && zComment[0] ){ |
| 89 | 89 | @ %w(zComment)<br /> |
| 90 | 90 | } |
| 91 | 91 | if( zPage==0 && zTkt==0 ){ |
| 92 | 92 | if( zSrc==0 || zSrc[0]==0 ){ |
| @@ -251,13 +251,13 @@ | ||
| 251 | 251 | } |
| 252 | 252 | zName += n; |
| 253 | 253 | if( zName[0]==0 ) zName = "unknown"; |
| 254 | 254 | blob_appendf(&manifest, "A %F %F %s\n", zName, zTarget, zUUID); |
| 255 | 255 | zComment = PD("comment", ""); |
| 256 | - while( isspace(zComment[0]) ) zComment++; | |
| 256 | + while( fossil_isspace(zComment[0]) ) zComment++; | |
| 257 | 257 | n = strlen(zComment); |
| 258 | - while( n>0 && isspace(zComment[n-1]) ){ n--; } | |
| 258 | + while( n>0 && fossil_isspace(zComment[n-1]) ){ n--; } | |
| 259 | 259 | if( n>0 ){ |
| 260 | 260 | blob_appendf(&manifest, "C %F\n", zComment); |
| 261 | 261 | } |
| 262 | 262 | zDate = db_text(0, "SELECT datetime('now')"); |
| 263 | 263 | zDate[10] = 'T'; |
| 264 | 264 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -82,11 +82,11 @@ | |
| 82 | zUrlTail = mprintf("page=%t&file=%t", zTarget, zFilename); |
| 83 | } |
| 84 | @ |
| 85 | @ <p><a href="/attachview?%s(zUrlTail)">%h(zFilename)</a> |
| 86 | @ [<a href="/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]<br /> |
| 87 | if( zComment ) while( isspace(zComment[0]) ) zComment++; |
| 88 | if( zComment && zComment[0] ){ |
| 89 | @ %w(zComment)<br /> |
| 90 | } |
| 91 | if( zPage==0 && zTkt==0 ){ |
| 92 | if( zSrc==0 || zSrc[0]==0 ){ |
| @@ -251,13 +251,13 @@ | |
| 251 | } |
| 252 | zName += n; |
| 253 | if( zName[0]==0 ) zName = "unknown"; |
| 254 | blob_appendf(&manifest, "A %F %F %s\n", zName, zTarget, zUUID); |
| 255 | zComment = PD("comment", ""); |
| 256 | while( isspace(zComment[0]) ) zComment++; |
| 257 | n = strlen(zComment); |
| 258 | while( n>0 && isspace(zComment[n-1]) ){ n--; } |
| 259 | if( n>0 ){ |
| 260 | blob_appendf(&manifest, "C %F\n", zComment); |
| 261 | } |
| 262 | zDate = db_text(0, "SELECT datetime('now')"); |
| 263 | zDate[10] = 'T'; |
| 264 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -82,11 +82,11 @@ | |
| 82 | zUrlTail = mprintf("page=%t&file=%t", zTarget, zFilename); |
| 83 | } |
| 84 | @ |
| 85 | @ <p><a href="/attachview?%s(zUrlTail)">%h(zFilename)</a> |
| 86 | @ [<a href="/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]<br /> |
| 87 | if( zComment ) while( fossil_isspace(zComment[0]) ) zComment++; |
| 88 | if( zComment && zComment[0] ){ |
| 89 | @ %w(zComment)<br /> |
| 90 | } |
| 91 | if( zPage==0 && zTkt==0 ){ |
| 92 | if( zSrc==0 || zSrc[0]==0 ){ |
| @@ -251,13 +251,13 @@ | |
| 251 | } |
| 252 | zName += n; |
| 253 | if( zName[0]==0 ) zName = "unknown"; |
| 254 | blob_appendf(&manifest, "A %F %F %s\n", zName, zTarget, zUUID); |
| 255 | zComment = PD("comment", ""); |
| 256 | while( fossil_isspace(zComment[0]) ) zComment++; |
| 257 | n = strlen(zComment); |
| 258 | while( n>0 && fossil_isspace(zComment[n-1]) ){ n--; } |
| 259 | if( n>0 ){ |
| 260 | blob_appendf(&manifest, "C %F\n", zComment); |
| 261 | } |
| 262 | zDate = db_text(0, "SELECT datetime('now')"); |
| 263 | zDate[10] = 'T'; |
| 264 |
+26
-9
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -72,25 +72,42 @@ | ||
| 72 | 72 | |
| 73 | 73 | /* |
| 74 | 74 | ** We find that the built-in isspace() function does not work for |
| 75 | 75 | ** some international character sets. So here is a substitute. |
| 76 | 76 | */ |
| 77 | -int blob_isspace(char c){ | |
| 77 | +int fossil_isspace(char c){ | |
| 78 | 78 | return c==' ' || (c<='\r' && c>='\t'); |
| 79 | 79 | } |
| 80 | + | |
| 81 | +/* | |
| 82 | +** Other replacements for ctype.h functions. | |
| 83 | +*/ | |
| 84 | +int fossil_islower(char c){ return c>='a' && c<='z'; } | |
| 85 | +int fossil_isupper(char c){ return c>='A' && c<='Z'; } | |
| 86 | +int fossil_isdigit(char c){ return c>='0' && c<='9'; } | |
| 87 | +int fossil_tolower(char c){ | |
| 88 | + return fossil_isupper(c) ? c - 'A' + 'a' : c; | |
| 89 | +} | |
| 90 | +int fossil_isalpha(char c){ | |
| 91 | + return (c>='a' && c<='z') || (c>='A' && c<='Z'); | |
| 92 | +} | |
| 93 | +int fossil_isalnum(char c){ | |
| 94 | + return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9'); | |
| 95 | +} | |
| 96 | + | |
| 80 | 97 | |
| 81 | 98 | /* |
| 82 | 99 | ** COMMAND: test-isspace |
| 83 | 100 | */ |
| 84 | 101 | void isspace_cmd(void){ |
| 85 | 102 | int i; |
| 86 | 103 | for(i=0; i<=255; i++){ |
| 87 | 104 | if( i==' ' || i=='\n' || i=='\t' || i=='\v' |
| 88 | 105 | || i=='\f' || i=='\r' ){ |
| 89 | - assert( blob_isspace((char)i) ); | |
| 106 | + assert( fossil_isspace((char)i) ); | |
| 90 | 107 | }else{ |
| 91 | - assert( !blob_isspace((char)i) ); | |
| 108 | + assert( !fossil_isspace((char)i) ); | |
| 92 | 109 | } |
| 93 | 110 | } |
| 94 | 111 | printf("All 256 characters OK\n"); |
| 95 | 112 | } |
| 96 | 113 | |
| @@ -429,11 +446,11 @@ | ||
| 429 | 446 | ** not insert a new zero terminator. |
| 430 | 447 | */ |
| 431 | 448 | int blob_trim(Blob *p){ |
| 432 | 449 | char *z = p->aData; |
| 433 | 450 | int n = p->nUsed; |
| 434 | - while( n>0 && blob_isspace(z[n-1]) ){ n--; } | |
| 451 | + while( n>0 && fossil_isspace(z[n-1]) ){ n--; } | |
| 435 | 452 | p->nUsed = n; |
| 436 | 453 | return n; |
| 437 | 454 | } |
| 438 | 455 | |
| 439 | 456 | /* |
| @@ -452,15 +469,15 @@ | ||
| 452 | 469 | */ |
| 453 | 470 | int blob_token(Blob *pFrom, Blob *pTo){ |
| 454 | 471 | char *aData = pFrom->aData; |
| 455 | 472 | int n = pFrom->nUsed; |
| 456 | 473 | int i = pFrom->iCursor; |
| 457 | - while( i<n && blob_isspace(aData[i]) ){ i++; } | |
| 474 | + while( i<n && fossil_isspace(aData[i]) ){ i++; } | |
| 458 | 475 | pFrom->iCursor = i; |
| 459 | - while( i<n && !blob_isspace(aData[i]) ){ i++; } | |
| 476 | + while( i<n && !fossil_isspace(aData[i]) ){ i++; } | |
| 460 | 477 | blob_extract(pFrom, i-pFrom->iCursor, pTo); |
| 461 | - while( i<n && blob_isspace(aData[i]) ){ i++; } | |
| 478 | + while( i<n && fossil_isspace(aData[i]) ){ i++; } | |
| 462 | 479 | pFrom->iCursor = i; |
| 463 | 480 | return pTo->nUsed; |
| 464 | 481 | } |
| 465 | 482 | |
| 466 | 483 | /* |
| @@ -523,11 +540,11 @@ | ||
| 523 | 540 | int blob_is_int(Blob *pBlob, int *pValue){ |
| 524 | 541 | const char *z = blob_buffer(pBlob); |
| 525 | 542 | int i, n, c, v; |
| 526 | 543 | n = blob_size(pBlob); |
| 527 | 544 | v = 0; |
| 528 | - for(i=0; i<n && (c = z[i])!=0 && isdigit(c); i++){ | |
| 545 | + for(i=0; i<n && (c = z[i])!=0 && c>='0' && c<='9'; i++){ | |
| 529 | 546 | v = v*10 + c - '0'; |
| 530 | 547 | } |
| 531 | 548 | if( i==n ){ |
| 532 | 549 | *pValue = v; |
| 533 | 550 | return 1; |
| @@ -906,11 +923,11 @@ | ||
| 906 | 923 | int n = blob_size(pBlob); |
| 907 | 924 | int k = strlen(zIn); |
| 908 | 925 | int i, c; |
| 909 | 926 | char *z; |
| 910 | 927 | for(i=0; (c = zIn[i])!=0; i++){ |
| 911 | - if( isspace(c) || c=='"' || (c=='\\' && zIn[i+1]!=0) ){ | |
| 928 | + if( fossil_isspace(c) || c=='"' || (c=='\\' && zIn[i+1]!=0) ){ | |
| 912 | 929 | blob_appendf(pBlob, "\"%s\"", zIn); |
| 913 | 930 | z = blob_buffer(pBlob); |
| 914 | 931 | for(i=n+1; i<=n+k; i++){ |
| 915 | 932 | if( z[i]=='"' ) z[i] = '_'; |
| 916 | 933 | } |
| 917 | 934 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -72,25 +72,42 @@ | |
| 72 | |
| 73 | /* |
| 74 | ** We find that the built-in isspace() function does not work for |
| 75 | ** some international character sets. So here is a substitute. |
| 76 | */ |
| 77 | int blob_isspace(char c){ |
| 78 | return c==' ' || (c<='\r' && c>='\t'); |
| 79 | } |
| 80 | |
| 81 | /* |
| 82 | ** COMMAND: test-isspace |
| 83 | */ |
| 84 | void isspace_cmd(void){ |
| 85 | int i; |
| 86 | for(i=0; i<=255; i++){ |
| 87 | if( i==' ' || i=='\n' || i=='\t' || i=='\v' |
| 88 | || i=='\f' || i=='\r' ){ |
| 89 | assert( blob_isspace((char)i) ); |
| 90 | }else{ |
| 91 | assert( !blob_isspace((char)i) ); |
| 92 | } |
| 93 | } |
| 94 | printf("All 256 characters OK\n"); |
| 95 | } |
| 96 | |
| @@ -429,11 +446,11 @@ | |
| 429 | ** not insert a new zero terminator. |
| 430 | */ |
| 431 | int blob_trim(Blob *p){ |
| 432 | char *z = p->aData; |
| 433 | int n = p->nUsed; |
| 434 | while( n>0 && blob_isspace(z[n-1]) ){ n--; } |
| 435 | p->nUsed = n; |
| 436 | return n; |
| 437 | } |
| 438 | |
| 439 | /* |
| @@ -452,15 +469,15 @@ | |
| 452 | */ |
| 453 | int blob_token(Blob *pFrom, Blob *pTo){ |
| 454 | char *aData = pFrom->aData; |
| 455 | int n = pFrom->nUsed; |
| 456 | int i = pFrom->iCursor; |
| 457 | while( i<n && blob_isspace(aData[i]) ){ i++; } |
| 458 | pFrom->iCursor = i; |
| 459 | while( i<n && !blob_isspace(aData[i]) ){ i++; } |
| 460 | blob_extract(pFrom, i-pFrom->iCursor, pTo); |
| 461 | while( i<n && blob_isspace(aData[i]) ){ i++; } |
| 462 | pFrom->iCursor = i; |
| 463 | return pTo->nUsed; |
| 464 | } |
| 465 | |
| 466 | /* |
| @@ -523,11 +540,11 @@ | |
| 523 | int blob_is_int(Blob *pBlob, int *pValue){ |
| 524 | const char *z = blob_buffer(pBlob); |
| 525 | int i, n, c, v; |
| 526 | n = blob_size(pBlob); |
| 527 | v = 0; |
| 528 | for(i=0; i<n && (c = z[i])!=0 && isdigit(c); i++){ |
| 529 | v = v*10 + c - '0'; |
| 530 | } |
| 531 | if( i==n ){ |
| 532 | *pValue = v; |
| 533 | return 1; |
| @@ -906,11 +923,11 @@ | |
| 906 | int n = blob_size(pBlob); |
| 907 | int k = strlen(zIn); |
| 908 | int i, c; |
| 909 | char *z; |
| 910 | for(i=0; (c = zIn[i])!=0; i++){ |
| 911 | if( isspace(c) || c=='"' || (c=='\\' && zIn[i+1]!=0) ){ |
| 912 | blob_appendf(pBlob, "\"%s\"", zIn); |
| 913 | z = blob_buffer(pBlob); |
| 914 | for(i=n+1; i<=n+k; i++){ |
| 915 | if( z[i]=='"' ) z[i] = '_'; |
| 916 | } |
| 917 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -72,25 +72,42 @@ | |
| 72 | |
| 73 | /* |
| 74 | ** We find that the built-in isspace() function does not work for |
| 75 | ** some international character sets. So here is a substitute. |
| 76 | */ |
| 77 | int fossil_isspace(char c){ |
| 78 | return c==' ' || (c<='\r' && c>='\t'); |
| 79 | } |
| 80 | |
| 81 | /* |
| 82 | ** Other replacements for ctype.h functions. |
| 83 | */ |
| 84 | int fossil_islower(char c){ return c>='a' && c<='z'; } |
| 85 | int fossil_isupper(char c){ return c>='A' && c<='Z'; } |
| 86 | int fossil_isdigit(char c){ return c>='0' && c<='9'; } |
| 87 | int fossil_tolower(char c){ |
| 88 | return fossil_isupper(c) ? c - 'A' + 'a' : c; |
| 89 | } |
| 90 | int fossil_isalpha(char c){ |
| 91 | return (c>='a' && c<='z') || (c>='A' && c<='Z'); |
| 92 | } |
| 93 | int fossil_isalnum(char c){ |
| 94 | return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9'); |
| 95 | } |
| 96 | |
| 97 | |
| 98 | /* |
| 99 | ** COMMAND: test-isspace |
| 100 | */ |
| 101 | void isspace_cmd(void){ |
| 102 | int i; |
| 103 | for(i=0; i<=255; i++){ |
| 104 | if( i==' ' || i=='\n' || i=='\t' || i=='\v' |
| 105 | || i=='\f' || i=='\r' ){ |
| 106 | assert( fossil_isspace((char)i) ); |
| 107 | }else{ |
| 108 | assert( !fossil_isspace((char)i) ); |
| 109 | } |
| 110 | } |
| 111 | printf("All 256 characters OK\n"); |
| 112 | } |
| 113 | |
| @@ -429,11 +446,11 @@ | |
| 446 | ** not insert a new zero terminator. |
| 447 | */ |
| 448 | int blob_trim(Blob *p){ |
| 449 | char *z = p->aData; |
| 450 | int n = p->nUsed; |
| 451 | while( n>0 && fossil_isspace(z[n-1]) ){ n--; } |
| 452 | p->nUsed = n; |
| 453 | return n; |
| 454 | } |
| 455 | |
| 456 | /* |
| @@ -452,15 +469,15 @@ | |
| 469 | */ |
| 470 | int blob_token(Blob *pFrom, Blob *pTo){ |
| 471 | char *aData = pFrom->aData; |
| 472 | int n = pFrom->nUsed; |
| 473 | int i = pFrom->iCursor; |
| 474 | while( i<n && fossil_isspace(aData[i]) ){ i++; } |
| 475 | pFrom->iCursor = i; |
| 476 | while( i<n && !fossil_isspace(aData[i]) ){ i++; } |
| 477 | blob_extract(pFrom, i-pFrom->iCursor, pTo); |
| 478 | while( i<n && fossil_isspace(aData[i]) ){ i++; } |
| 479 | pFrom->iCursor = i; |
| 480 | return pTo->nUsed; |
| 481 | } |
| 482 | |
| 483 | /* |
| @@ -523,11 +540,11 @@ | |
| 540 | int blob_is_int(Blob *pBlob, int *pValue){ |
| 541 | const char *z = blob_buffer(pBlob); |
| 542 | int i, n, c, v; |
| 543 | n = blob_size(pBlob); |
| 544 | v = 0; |
| 545 | for(i=0; i<n && (c = z[i])!=0 && c>='0' && c<='9'; i++){ |
| 546 | v = v*10 + c - '0'; |
| 547 | } |
| 548 | if( i==n ){ |
| 549 | *pValue = v; |
| 550 | return 1; |
| @@ -906,11 +923,11 @@ | |
| 923 | int n = blob_size(pBlob); |
| 924 | int k = strlen(zIn); |
| 925 | int i, c; |
| 926 | char *z; |
| 927 | for(i=0; (c = zIn[i])!=0; i++){ |
| 928 | if( fossil_isspace(c) || c=='"' || (c=='\\' && zIn[i+1]!=0) ){ |
| 929 | blob_appendf(pBlob, "\"%s\"", zIn); |
| 930 | z = blob_buffer(pBlob); |
| 931 | for(i=n+1; i<=n+k; i++){ |
| 932 | if( z[i]=='"' ) z[i] = '_'; |
| 933 | } |
| 934 |
+17
-15
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -463,11 +463,11 @@ | ||
| 463 | 463 | */ |
| 464 | 464 | static void add_param_list(char *z, int terminator){ |
| 465 | 465 | while( *z ){ |
| 466 | 466 | char *zName; |
| 467 | 467 | char *zValue; |
| 468 | - while( isspace(*z) ){ z++; } | |
| 468 | + while( fossil_isspace(*z) ){ z++; } | |
| 469 | 469 | zName = z; |
| 470 | 470 | while( *z && *z!='=' && *z!=terminator ){ z++; } |
| 471 | 471 | if( *z=='=' ){ |
| 472 | 472 | *z = 0; |
| 473 | 473 | z++; |
| @@ -480,11 +480,11 @@ | ||
| 480 | 480 | dehttpize(zValue); |
| 481 | 481 | }else{ |
| 482 | 482 | if( *z ){ *z++ = 0; } |
| 483 | 483 | zValue = ""; |
| 484 | 484 | } |
| 485 | - if( islower(zName[0]) ){ | |
| 485 | + if( fossil_islower(zName[0]) ){ | |
| 486 | 486 | cgi_set_parameter_nocopy(zName, zValue); |
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | } |
| 490 | 490 | |
| @@ -575,11 +575,11 @@ | ||
| 575 | 575 | ** in the example above. |
| 576 | 576 | */ |
| 577 | 577 | static int tokenize_line(char *z, int mxArg, char **azArg){ |
| 578 | 578 | int i = 0; |
| 579 | 579 | while( *z ){ |
| 580 | - while( isspace(*z) || *z==';' ){ z++; } | |
| 580 | + while( fossil_isspace(*z) || *z==';' ){ z++; } | |
| 581 | 581 | if( *z=='"' && z[1] ){ |
| 582 | 582 | *z = 0; |
| 583 | 583 | z++; |
| 584 | 584 | if( i<mxArg-1 ){ azArg[i++] = z; } |
| 585 | 585 | while( *z && *z!='"' ){ z++; } |
| @@ -586,11 +586,11 @@ | ||
| 586 | 586 | if( *z==0 ) break; |
| 587 | 587 | *z = 0; |
| 588 | 588 | z++; |
| 589 | 589 | }else{ |
| 590 | 590 | if( i<mxArg-1 ){ azArg[i++] = z; } |
| 591 | - while( *z && !isspace(*z) && *z!=';' && *z!='"' ){ z++; } | |
| 591 | + while( *z && !fossil_isspace(*z) && *z!=';' && *z!='"' ){ z++; } | |
| 592 | 592 | if( *z && *z!='"' ){ |
| 593 | 593 | *z = 0; |
| 594 | 594 | z++; |
| 595 | 595 | } |
| 596 | 596 | } |
| @@ -621,11 +621,11 @@ | ||
| 621 | 621 | if( zBoundry==0 ) return; |
| 622 | 622 | while( (zLine = get_line_from_string(&z, &len))!=0 ){ |
| 623 | 623 | if( zLine[0]==0 ){ |
| 624 | 624 | int nContent = 0; |
| 625 | 625 | zValue = get_bounded_content(&z, &len, zBoundry, &nContent); |
| 626 | - if( zName && zValue && islower(zName[0]) ){ | |
| 626 | + if( zName && zValue && fossil_islower(zName[0]) ){ | |
| 627 | 627 | cgi_set_parameter_nocopy(zName, zValue); |
| 628 | 628 | if( showBytes ){ |
| 629 | 629 | cgi_set_parameter_nocopy(mprintf("%s:bytes", zName), |
| 630 | 630 | mprintf("%d",nContent)); |
| 631 | 631 | } |
| @@ -633,25 +633,25 @@ | ||
| 633 | 633 | zName = 0; |
| 634 | 634 | showBytes = 0; |
| 635 | 635 | }else{ |
| 636 | 636 | nArg = tokenize_line(zLine, sizeof(azArg)/sizeof(azArg[0]), azArg); |
| 637 | 637 | for(i=0; i<nArg; i++){ |
| 638 | - int c = tolower(azArg[i][0]); | |
| 638 | + int c = fossil_tolower(azArg[i][0]); | |
| 639 | 639 | int n = strlen(azArg[i]); |
| 640 | 640 | if( c=='c' && sqlite3_strnicmp(azArg[i],"content-disposition:",n)==0 ){ |
| 641 | 641 | i++; |
| 642 | 642 | }else if( c=='n' && sqlite3_strnicmp(azArg[i],"name=",n)==0 ){ |
| 643 | 643 | zName = azArg[++i]; |
| 644 | 644 | }else if( c=='f' && sqlite3_strnicmp(azArg[i],"filename=",n)==0 ){ |
| 645 | 645 | char *z = azArg[++i]; |
| 646 | - if( zName && z && islower(zName[0]) ){ | |
| 646 | + if( zName && z && fossil_islower(zName[0]) ){ | |
| 647 | 647 | cgi_set_parameter_nocopy(mprintf("%s:filename",zName), z); |
| 648 | 648 | } |
| 649 | 649 | showBytes = 1; |
| 650 | 650 | }else if( c=='c' && sqlite3_strnicmp(azArg[i],"content-type:",n)==0 ){ |
| 651 | 651 | char *z = azArg[++i]; |
| 652 | - if( zName && z && islower(zName[0]) ){ | |
| 652 | + if( zName && z && fossil_islower(zName[0]) ){ | |
| 653 | 653 | cgi_set_parameter_nocopy(mprintf("%s:mimetype",zName), z); |
| 654 | 654 | } |
| 655 | 655 | } |
| 656 | 656 | } |
| 657 | 657 | } |
| @@ -773,11 +773,11 @@ | ||
| 773 | 773 | |
| 774 | 774 | /* If no match is found and the name begins with an upper-case |
| 775 | 775 | ** letter, then check to see if there is an environment variable |
| 776 | 776 | ** with the given name. |
| 777 | 777 | */ |
| 778 | - if( isupper(zName[0]) ){ | |
| 778 | + if( fossil_isupper(zName[0]) ){ | |
| 779 | 779 | const char *zValue = getenv(zName); |
| 780 | 780 | if( zValue ){ |
| 781 | 781 | cgi_set_parameter_nocopy(zName, zValue); |
| 782 | 782 | CGIDEBUG(("env-match [%s] = [%s]\n", zName, zValue)); |
| 783 | 783 | return zValue; |
| @@ -916,17 +916,17 @@ | ||
| 916 | 916 | char *zResult = 0; |
| 917 | 917 | if( zInput==0 ){ |
| 918 | 918 | if( zLeftOver ) *zLeftOver = 0; |
| 919 | 919 | return 0; |
| 920 | 920 | } |
| 921 | - while( isspace(*zInput) ){ zInput++; } | |
| 921 | + while( fossil_isspace(*zInput) ){ zInput++; } | |
| 922 | 922 | zResult = zInput; |
| 923 | - while( *zInput && !isspace(*zInput) ){ zInput++; } | |
| 923 | + while( *zInput && !fossil_isspace(*zInput) ){ zInput++; } | |
| 924 | 924 | if( *zInput ){ |
| 925 | 925 | *zInput = 0; |
| 926 | 926 | zInput++; |
| 927 | - while( isspace(*zInput) ){ zInput++; } | |
| 927 | + while( fossil_isspace(*zInput) ){ zInput++; } | |
| 928 | 928 | } |
| 929 | 929 | if( zLeftOver ){ *zLeftOver = zInput; } |
| 930 | 930 | return zResult; |
| 931 | 931 | } |
| 932 | 932 | |
| @@ -986,15 +986,17 @@ | ||
| 986 | 986 | char *zFieldName; |
| 987 | 987 | char *zVal; |
| 988 | 988 | |
| 989 | 989 | zFieldName = extract_token(zLine,&zVal); |
| 990 | 990 | if( zFieldName==0 || *zFieldName==0 ) break; |
| 991 | - while( isspace(*zVal) ){ zVal++; } | |
| 991 | + while( fossil_isspace(*zVal) ){ zVal++; } | |
| 992 | 992 | i = strlen(zVal); |
| 993 | - while( i>0 && isspace(zVal[i-1]) ){ i--; } | |
| 993 | + while( i>0 && fossil_isspace(zVal[i-1]) ){ i--; } | |
| 994 | 994 | zVal[i] = 0; |
| 995 | - for(i=0; zFieldName[i]; i++){ zFieldName[i] = tolower(zFieldName[i]); } | |
| 995 | + for(i=0; zFieldName[i]; i++){ | |
| 996 | + zFieldName[i] = fossil_tolower(zFieldName[i]); | |
| 997 | + } | |
| 996 | 998 | if( strcmp(zFieldName,"content-length:")==0 ){ |
| 997 | 999 | cgi_setenv("CONTENT_LENGTH", zVal); |
| 998 | 1000 | }else if( strcmp(zFieldName,"content-type:")==0 ){ |
| 999 | 1001 | cgi_setenv("CONTENT_TYPE", zVal); |
| 1000 | 1002 | }else if( strcmp(zFieldName,"cookie:")==0 ){ |
| 1001 | 1003 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -463,11 +463,11 @@ | |
| 463 | */ |
| 464 | static void add_param_list(char *z, int terminator){ |
| 465 | while( *z ){ |
| 466 | char *zName; |
| 467 | char *zValue; |
| 468 | while( isspace(*z) ){ z++; } |
| 469 | zName = z; |
| 470 | while( *z && *z!='=' && *z!=terminator ){ z++; } |
| 471 | if( *z=='=' ){ |
| 472 | *z = 0; |
| 473 | z++; |
| @@ -480,11 +480,11 @@ | |
| 480 | dehttpize(zValue); |
| 481 | }else{ |
| 482 | if( *z ){ *z++ = 0; } |
| 483 | zValue = ""; |
| 484 | } |
| 485 | if( islower(zName[0]) ){ |
| 486 | cgi_set_parameter_nocopy(zName, zValue); |
| 487 | } |
| 488 | } |
| 489 | } |
| 490 | |
| @@ -575,11 +575,11 @@ | |
| 575 | ** in the example above. |
| 576 | */ |
| 577 | static int tokenize_line(char *z, int mxArg, char **azArg){ |
| 578 | int i = 0; |
| 579 | while( *z ){ |
| 580 | while( isspace(*z) || *z==';' ){ z++; } |
| 581 | if( *z=='"' && z[1] ){ |
| 582 | *z = 0; |
| 583 | z++; |
| 584 | if( i<mxArg-1 ){ azArg[i++] = z; } |
| 585 | while( *z && *z!='"' ){ z++; } |
| @@ -586,11 +586,11 @@ | |
| 586 | if( *z==0 ) break; |
| 587 | *z = 0; |
| 588 | z++; |
| 589 | }else{ |
| 590 | if( i<mxArg-1 ){ azArg[i++] = z; } |
| 591 | while( *z && !isspace(*z) && *z!=';' && *z!='"' ){ z++; } |
| 592 | if( *z && *z!='"' ){ |
| 593 | *z = 0; |
| 594 | z++; |
| 595 | } |
| 596 | } |
| @@ -621,11 +621,11 @@ | |
| 621 | if( zBoundry==0 ) return; |
| 622 | while( (zLine = get_line_from_string(&z, &len))!=0 ){ |
| 623 | if( zLine[0]==0 ){ |
| 624 | int nContent = 0; |
| 625 | zValue = get_bounded_content(&z, &len, zBoundry, &nContent); |
| 626 | if( zName && zValue && islower(zName[0]) ){ |
| 627 | cgi_set_parameter_nocopy(zName, zValue); |
| 628 | if( showBytes ){ |
| 629 | cgi_set_parameter_nocopy(mprintf("%s:bytes", zName), |
| 630 | mprintf("%d",nContent)); |
| 631 | } |
| @@ -633,25 +633,25 @@ | |
| 633 | zName = 0; |
| 634 | showBytes = 0; |
| 635 | }else{ |
| 636 | nArg = tokenize_line(zLine, sizeof(azArg)/sizeof(azArg[0]), azArg); |
| 637 | for(i=0; i<nArg; i++){ |
| 638 | int c = tolower(azArg[i][0]); |
| 639 | int n = strlen(azArg[i]); |
| 640 | if( c=='c' && sqlite3_strnicmp(azArg[i],"content-disposition:",n)==0 ){ |
| 641 | i++; |
| 642 | }else if( c=='n' && sqlite3_strnicmp(azArg[i],"name=",n)==0 ){ |
| 643 | zName = azArg[++i]; |
| 644 | }else if( c=='f' && sqlite3_strnicmp(azArg[i],"filename=",n)==0 ){ |
| 645 | char *z = azArg[++i]; |
| 646 | if( zName && z && islower(zName[0]) ){ |
| 647 | cgi_set_parameter_nocopy(mprintf("%s:filename",zName), z); |
| 648 | } |
| 649 | showBytes = 1; |
| 650 | }else if( c=='c' && sqlite3_strnicmp(azArg[i],"content-type:",n)==0 ){ |
| 651 | char *z = azArg[++i]; |
| 652 | if( zName && z && islower(zName[0]) ){ |
| 653 | cgi_set_parameter_nocopy(mprintf("%s:mimetype",zName), z); |
| 654 | } |
| 655 | } |
| 656 | } |
| 657 | } |
| @@ -773,11 +773,11 @@ | |
| 773 | |
| 774 | /* If no match is found and the name begins with an upper-case |
| 775 | ** letter, then check to see if there is an environment variable |
| 776 | ** with the given name. |
| 777 | */ |
| 778 | if( isupper(zName[0]) ){ |
| 779 | const char *zValue = getenv(zName); |
| 780 | if( zValue ){ |
| 781 | cgi_set_parameter_nocopy(zName, zValue); |
| 782 | CGIDEBUG(("env-match [%s] = [%s]\n", zName, zValue)); |
| 783 | return zValue; |
| @@ -916,17 +916,17 @@ | |
| 916 | char *zResult = 0; |
| 917 | if( zInput==0 ){ |
| 918 | if( zLeftOver ) *zLeftOver = 0; |
| 919 | return 0; |
| 920 | } |
| 921 | while( isspace(*zInput) ){ zInput++; } |
| 922 | zResult = zInput; |
| 923 | while( *zInput && !isspace(*zInput) ){ zInput++; } |
| 924 | if( *zInput ){ |
| 925 | *zInput = 0; |
| 926 | zInput++; |
| 927 | while( isspace(*zInput) ){ zInput++; } |
| 928 | } |
| 929 | if( zLeftOver ){ *zLeftOver = zInput; } |
| 930 | return zResult; |
| 931 | } |
| 932 | |
| @@ -986,15 +986,17 @@ | |
| 986 | char *zFieldName; |
| 987 | char *zVal; |
| 988 | |
| 989 | zFieldName = extract_token(zLine,&zVal); |
| 990 | if( zFieldName==0 || *zFieldName==0 ) break; |
| 991 | while( isspace(*zVal) ){ zVal++; } |
| 992 | i = strlen(zVal); |
| 993 | while( i>0 && isspace(zVal[i-1]) ){ i--; } |
| 994 | zVal[i] = 0; |
| 995 | for(i=0; zFieldName[i]; i++){ zFieldName[i] = tolower(zFieldName[i]); } |
| 996 | if( strcmp(zFieldName,"content-length:")==0 ){ |
| 997 | cgi_setenv("CONTENT_LENGTH", zVal); |
| 998 | }else if( strcmp(zFieldName,"content-type:")==0 ){ |
| 999 | cgi_setenv("CONTENT_TYPE", zVal); |
| 1000 | }else if( strcmp(zFieldName,"cookie:")==0 ){ |
| 1001 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -463,11 +463,11 @@ | |
| 463 | */ |
| 464 | static void add_param_list(char *z, int terminator){ |
| 465 | while( *z ){ |
| 466 | char *zName; |
| 467 | char *zValue; |
| 468 | while( fossil_isspace(*z) ){ z++; } |
| 469 | zName = z; |
| 470 | while( *z && *z!='=' && *z!=terminator ){ z++; } |
| 471 | if( *z=='=' ){ |
| 472 | *z = 0; |
| 473 | z++; |
| @@ -480,11 +480,11 @@ | |
| 480 | dehttpize(zValue); |
| 481 | }else{ |
| 482 | if( *z ){ *z++ = 0; } |
| 483 | zValue = ""; |
| 484 | } |
| 485 | if( fossil_islower(zName[0]) ){ |
| 486 | cgi_set_parameter_nocopy(zName, zValue); |
| 487 | } |
| 488 | } |
| 489 | } |
| 490 | |
| @@ -575,11 +575,11 @@ | |
| 575 | ** in the example above. |
| 576 | */ |
| 577 | static int tokenize_line(char *z, int mxArg, char **azArg){ |
| 578 | int i = 0; |
| 579 | while( *z ){ |
| 580 | while( fossil_isspace(*z) || *z==';' ){ z++; } |
| 581 | if( *z=='"' && z[1] ){ |
| 582 | *z = 0; |
| 583 | z++; |
| 584 | if( i<mxArg-1 ){ azArg[i++] = z; } |
| 585 | while( *z && *z!='"' ){ z++; } |
| @@ -586,11 +586,11 @@ | |
| 586 | if( *z==0 ) break; |
| 587 | *z = 0; |
| 588 | z++; |
| 589 | }else{ |
| 590 | if( i<mxArg-1 ){ azArg[i++] = z; } |
| 591 | while( *z && !fossil_isspace(*z) && *z!=';' && *z!='"' ){ z++; } |
| 592 | if( *z && *z!='"' ){ |
| 593 | *z = 0; |
| 594 | z++; |
| 595 | } |
| 596 | } |
| @@ -621,11 +621,11 @@ | |
| 621 | if( zBoundry==0 ) return; |
| 622 | while( (zLine = get_line_from_string(&z, &len))!=0 ){ |
| 623 | if( zLine[0]==0 ){ |
| 624 | int nContent = 0; |
| 625 | zValue = get_bounded_content(&z, &len, zBoundry, &nContent); |
| 626 | if( zName && zValue && fossil_islower(zName[0]) ){ |
| 627 | cgi_set_parameter_nocopy(zName, zValue); |
| 628 | if( showBytes ){ |
| 629 | cgi_set_parameter_nocopy(mprintf("%s:bytes", zName), |
| 630 | mprintf("%d",nContent)); |
| 631 | } |
| @@ -633,25 +633,25 @@ | |
| 633 | zName = 0; |
| 634 | showBytes = 0; |
| 635 | }else{ |
| 636 | nArg = tokenize_line(zLine, sizeof(azArg)/sizeof(azArg[0]), azArg); |
| 637 | for(i=0; i<nArg; i++){ |
| 638 | int c = fossil_tolower(azArg[i][0]); |
| 639 | int n = strlen(azArg[i]); |
| 640 | if( c=='c' && sqlite3_strnicmp(azArg[i],"content-disposition:",n)==0 ){ |
| 641 | i++; |
| 642 | }else if( c=='n' && sqlite3_strnicmp(azArg[i],"name=",n)==0 ){ |
| 643 | zName = azArg[++i]; |
| 644 | }else if( c=='f' && sqlite3_strnicmp(azArg[i],"filename=",n)==0 ){ |
| 645 | char *z = azArg[++i]; |
| 646 | if( zName && z && fossil_islower(zName[0]) ){ |
| 647 | cgi_set_parameter_nocopy(mprintf("%s:filename",zName), z); |
| 648 | } |
| 649 | showBytes = 1; |
| 650 | }else if( c=='c' && sqlite3_strnicmp(azArg[i],"content-type:",n)==0 ){ |
| 651 | char *z = azArg[++i]; |
| 652 | if( zName && z && fossil_islower(zName[0]) ){ |
| 653 | cgi_set_parameter_nocopy(mprintf("%s:mimetype",zName), z); |
| 654 | } |
| 655 | } |
| 656 | } |
| 657 | } |
| @@ -773,11 +773,11 @@ | |
| 773 | |
| 774 | /* If no match is found and the name begins with an upper-case |
| 775 | ** letter, then check to see if there is an environment variable |
| 776 | ** with the given name. |
| 777 | */ |
| 778 | if( fossil_isupper(zName[0]) ){ |
| 779 | const char *zValue = getenv(zName); |
| 780 | if( zValue ){ |
| 781 | cgi_set_parameter_nocopy(zName, zValue); |
| 782 | CGIDEBUG(("env-match [%s] = [%s]\n", zName, zValue)); |
| 783 | return zValue; |
| @@ -916,17 +916,17 @@ | |
| 916 | char *zResult = 0; |
| 917 | if( zInput==0 ){ |
| 918 | if( zLeftOver ) *zLeftOver = 0; |
| 919 | return 0; |
| 920 | } |
| 921 | while( fossil_isspace(*zInput) ){ zInput++; } |
| 922 | zResult = zInput; |
| 923 | while( *zInput && !fossil_isspace(*zInput) ){ zInput++; } |
| 924 | if( *zInput ){ |
| 925 | *zInput = 0; |
| 926 | zInput++; |
| 927 | while( fossil_isspace(*zInput) ){ zInput++; } |
| 928 | } |
| 929 | if( zLeftOver ){ *zLeftOver = zInput; } |
| 930 | return zResult; |
| 931 | } |
| 932 | |
| @@ -986,15 +986,17 @@ | |
| 986 | char *zFieldName; |
| 987 | char *zVal; |
| 988 | |
| 989 | zFieldName = extract_token(zLine,&zVal); |
| 990 | if( zFieldName==0 || *zFieldName==0 ) break; |
| 991 | while( fossil_isspace(*zVal) ){ zVal++; } |
| 992 | i = strlen(zVal); |
| 993 | while( i>0 && fossil_isspace(zVal[i-1]) ){ i--; } |
| 994 | zVal[i] = 0; |
| 995 | for(i=0; zFieldName[i]; i++){ |
| 996 | zFieldName[i] = fossil_tolower(zFieldName[i]); |
| 997 | } |
| 998 | if( strcmp(zFieldName,"content-length:")==0 ){ |
| 999 | cgi_setenv("CONTENT_LENGTH", zVal); |
| 1000 | }else if( strcmp(zFieldName,"content-type:")==0 ){ |
| 1001 | cgi_setenv("CONTENT_TYPE", zVal); |
| 1002 | }else if( strcmp(zFieldName,"cookie:")==0 ){ |
| 1003 |
+4
-4
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -215,21 +215,21 @@ | ||
| 215 | 215 | int cTerm; |
| 216 | 216 | |
| 217 | 217 | if( zGlobList==0 || zGlobList[0]==0 ) return "0"; |
| 218 | 218 | blob_zero(&expr); |
| 219 | 219 | while( zGlobList[0] ){ |
| 220 | - while( isspace(zGlobList[0]) || zGlobList[0]==',' ) zGlobList++; | |
| 220 | + while( fossil_isspace(zGlobList[0]) || zGlobList[0]==',' ) zGlobList++; | |
| 221 | 221 | if( zGlobList[0]==0 ) break; |
| 222 | 222 | if( zGlobList[0]=='\'' || zGlobList[0]=='"' ){ |
| 223 | 223 | cTerm = zGlobList[0]; |
| 224 | 224 | zGlobList++; |
| 225 | 225 | }else{ |
| 226 | 226 | cTerm = ','; |
| 227 | 227 | } |
| 228 | 228 | for(i=0; zGlobList[i] && zGlobList[i]!=cTerm; i++){} |
| 229 | 229 | if( cTerm==',' ){ |
| 230 | - while( i>0 && isspace(zGlobList[i-1]) ){ i--; } | |
| 230 | + while( i>0 && fossil_isspace(zGlobList[i-1]) ){ i--; } | |
| 231 | 231 | } |
| 232 | 232 | blob_appendf(&expr, "%s%s GLOB '%.*q'", zSep, zVal, i, zGlobList); |
| 233 | 233 | zSep = " OR "; |
| 234 | 234 | if( cTerm!=',' && zGlobList[i] ) i++; |
| 235 | 235 | zGlobList += i; |
| @@ -429,20 +429,20 @@ | ||
| 429 | 429 | while( blob_line(&text, &line) ){ |
| 430 | 430 | int i, n; |
| 431 | 431 | char *z; |
| 432 | 432 | n = blob_size(&line); |
| 433 | 433 | z = blob_buffer(&line); |
| 434 | - for(i=0; i<n && isspace(z[i]); i++){} | |
| 434 | + for(i=0; i<n && fossil_isspace(z[i]); i++){} | |
| 435 | 435 | if( i<n && z[i]=='#' ) continue; |
| 436 | 436 | if( i<n || blob_size(pComment)>0 ){ |
| 437 | 437 | blob_appendf(pComment, "%b", &line); |
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 | blob_reset(&text); |
| 441 | 441 | zComment = blob_str(pComment); |
| 442 | 442 | i = strlen(zComment); |
| 443 | - while( i>0 && isspace(zComment[i-1]) ){ i--; } | |
| 443 | + while( i>0 && fossil_isspace(zComment[i-1]) ){ i--; } | |
| 444 | 444 | blob_resize(pComment, i); |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | /* |
| 448 | 448 | ** Populate the Global.aCommitFile[] based on the command line arguments |
| 449 | 449 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -215,21 +215,21 @@ | |
| 215 | int cTerm; |
| 216 | |
| 217 | if( zGlobList==0 || zGlobList[0]==0 ) return "0"; |
| 218 | blob_zero(&expr); |
| 219 | while( zGlobList[0] ){ |
| 220 | while( isspace(zGlobList[0]) || zGlobList[0]==',' ) zGlobList++; |
| 221 | if( zGlobList[0]==0 ) break; |
| 222 | if( zGlobList[0]=='\'' || zGlobList[0]=='"' ){ |
| 223 | cTerm = zGlobList[0]; |
| 224 | zGlobList++; |
| 225 | }else{ |
| 226 | cTerm = ','; |
| 227 | } |
| 228 | for(i=0; zGlobList[i] && zGlobList[i]!=cTerm; i++){} |
| 229 | if( cTerm==',' ){ |
| 230 | while( i>0 && isspace(zGlobList[i-1]) ){ i--; } |
| 231 | } |
| 232 | blob_appendf(&expr, "%s%s GLOB '%.*q'", zSep, zVal, i, zGlobList); |
| 233 | zSep = " OR "; |
| 234 | if( cTerm!=',' && zGlobList[i] ) i++; |
| 235 | zGlobList += i; |
| @@ -429,20 +429,20 @@ | |
| 429 | while( blob_line(&text, &line) ){ |
| 430 | int i, n; |
| 431 | char *z; |
| 432 | n = blob_size(&line); |
| 433 | z = blob_buffer(&line); |
| 434 | for(i=0; i<n && isspace(z[i]); i++){} |
| 435 | if( i<n && z[i]=='#' ) continue; |
| 436 | if( i<n || blob_size(pComment)>0 ){ |
| 437 | blob_appendf(pComment, "%b", &line); |
| 438 | } |
| 439 | } |
| 440 | blob_reset(&text); |
| 441 | zComment = blob_str(pComment); |
| 442 | i = strlen(zComment); |
| 443 | while( i>0 && isspace(zComment[i-1]) ){ i--; } |
| 444 | blob_resize(pComment, i); |
| 445 | } |
| 446 | |
| 447 | /* |
| 448 | ** Populate the Global.aCommitFile[] based on the command line arguments |
| 449 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -215,21 +215,21 @@ | |
| 215 | int cTerm; |
| 216 | |
| 217 | if( zGlobList==0 || zGlobList[0]==0 ) return "0"; |
| 218 | blob_zero(&expr); |
| 219 | while( zGlobList[0] ){ |
| 220 | while( fossil_isspace(zGlobList[0]) || zGlobList[0]==',' ) zGlobList++; |
| 221 | if( zGlobList[0]==0 ) break; |
| 222 | if( zGlobList[0]=='\'' || zGlobList[0]=='"' ){ |
| 223 | cTerm = zGlobList[0]; |
| 224 | zGlobList++; |
| 225 | }else{ |
| 226 | cTerm = ','; |
| 227 | } |
| 228 | for(i=0; zGlobList[i] && zGlobList[i]!=cTerm; i++){} |
| 229 | if( cTerm==',' ){ |
| 230 | while( i>0 && fossil_isspace(zGlobList[i-1]) ){ i--; } |
| 231 | } |
| 232 | blob_appendf(&expr, "%s%s GLOB '%.*q'", zSep, zVal, i, zGlobList); |
| 233 | zSep = " OR "; |
| 234 | if( cTerm!=',' && zGlobList[i] ) i++; |
| 235 | zGlobList += i; |
| @@ -429,20 +429,20 @@ | |
| 429 | while( blob_line(&text, &line) ){ |
| 430 | int i, n; |
| 431 | char *z; |
| 432 | n = blob_size(&line); |
| 433 | z = blob_buffer(&line); |
| 434 | for(i=0; i<n && fossil_isspace(z[i]); i++){} |
| 435 | if( i<n && z[i]=='#' ) continue; |
| 436 | if( i<n || blob_size(pComment)>0 ){ |
| 437 | blob_appendf(pComment, "%b", &line); |
| 438 | } |
| 439 | } |
| 440 | blob_reset(&text); |
| 441 | zComment = blob_str(pComment); |
| 442 | i = strlen(zComment); |
| 443 | while( i>0 && fossil_isspace(zComment[i-1]) ){ i--; } |
| 444 | blob_resize(pComment, i); |
| 445 | } |
| 446 | |
| 447 | /* |
| 448 | ** Populate the Global.aCommitFile[] based on the command line arguments |
| 449 |
+3
-3
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -38,29 +38,29 @@ | ||
| 38 | 38 | int doIndent = 0; |
| 39 | 39 | char zBuf[400]; |
| 40 | 40 | int lineCnt = 0; |
| 41 | 41 | |
| 42 | 42 | for(;;){ |
| 43 | - while( isspace(zText[0]) ){ zText++; } | |
| 43 | + while( fossil_isspace(zText[0]) ){ zText++; } | |
| 44 | 44 | if( zText[0]==0 ){ |
| 45 | 45 | if( doIndent==0 ){ |
| 46 | 46 | printf("\n"); |
| 47 | 47 | lineCnt = 1; |
| 48 | 48 | } |
| 49 | 49 | return lineCnt; |
| 50 | 50 | } |
| 51 | 51 | for(sk=si=i=k=0; zText[i] && k<tlen; i++){ |
| 52 | 52 | char c = zText[i]; |
| 53 | - if( isspace(c) ){ | |
| 53 | + if( fossil_isspace(c) ){ | |
| 54 | 54 | si = i; |
| 55 | 55 | sk = k; |
| 56 | 56 | if( k==0 || zBuf[k-1]!=' ' ){ |
| 57 | 57 | zBuf[k++] = ' '; |
| 58 | 58 | } |
| 59 | 59 | }else{ |
| 60 | 60 | zBuf[k] = c; |
| 61 | - if( c=='-' && k>0 && isalpha(zBuf[k-1]) ){ | |
| 61 | + if( c=='-' && k>0 && fossil_isalpha(zBuf[k-1]) ){ | |
| 62 | 62 | si = i+1; |
| 63 | 63 | sk = k+1; |
| 64 | 64 | } |
| 65 | 65 | k++; |
| 66 | 66 | } |
| 67 | 67 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -38,29 +38,29 @@ | |
| 38 | int doIndent = 0; |
| 39 | char zBuf[400]; |
| 40 | int lineCnt = 0; |
| 41 | |
| 42 | for(;;){ |
| 43 | while( isspace(zText[0]) ){ zText++; } |
| 44 | if( zText[0]==0 ){ |
| 45 | if( doIndent==0 ){ |
| 46 | printf("\n"); |
| 47 | lineCnt = 1; |
| 48 | } |
| 49 | return lineCnt; |
| 50 | } |
| 51 | for(sk=si=i=k=0; zText[i] && k<tlen; i++){ |
| 52 | char c = zText[i]; |
| 53 | if( isspace(c) ){ |
| 54 | si = i; |
| 55 | sk = k; |
| 56 | if( k==0 || zBuf[k-1]!=' ' ){ |
| 57 | zBuf[k++] = ' '; |
| 58 | } |
| 59 | }else{ |
| 60 | zBuf[k] = c; |
| 61 | if( c=='-' && k>0 && isalpha(zBuf[k-1]) ){ |
| 62 | si = i+1; |
| 63 | sk = k+1; |
| 64 | } |
| 65 | k++; |
| 66 | } |
| 67 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -38,29 +38,29 @@ | |
| 38 | int doIndent = 0; |
| 39 | char zBuf[400]; |
| 40 | int lineCnt = 0; |
| 41 | |
| 42 | for(;;){ |
| 43 | while( fossil_isspace(zText[0]) ){ zText++; } |
| 44 | if( zText[0]==0 ){ |
| 45 | if( doIndent==0 ){ |
| 46 | printf("\n"); |
| 47 | lineCnt = 1; |
| 48 | } |
| 49 | return lineCnt; |
| 50 | } |
| 51 | for(sk=si=i=k=0; zText[i] && k<tlen; i++){ |
| 52 | char c = zText[i]; |
| 53 | if( fossil_isspace(c) ){ |
| 54 | si = i; |
| 55 | sk = k; |
| 56 | if( k==0 || zBuf[k-1]!=' ' ){ |
| 57 | zBuf[k++] = ' '; |
| 58 | } |
| 59 | }else{ |
| 60 | zBuf[k] = c; |
| 61 | if( c=='-' && k>0 && fossil_isalpha(zBuf[k-1]) ){ |
| 62 | si = i+1; |
| 63 | sk = k+1; |
| 64 | } |
| 65 | k++; |
| 66 | } |
| 67 |
+1
-1
| --- src/config.h | ||
| +++ src/config.h | ||
| @@ -33,11 +33,11 @@ | ||
| 33 | 33 | ** System header files used by all modules |
| 34 | 34 | */ |
| 35 | 35 | #include <unistd.h> |
| 36 | 36 | #include <stdio.h> |
| 37 | 37 | #include <stdlib.h> |
| 38 | -#include <ctype.h> | |
| 38 | +/* #include <ctype.h> // do not use - causes problems */ | |
| 39 | 39 | #include <string.h> |
| 40 | 40 | #include <stdarg.h> |
| 41 | 41 | #include <assert.h> |
| 42 | 42 | |
| 43 | 43 | #endif |
| 44 | 44 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -33,11 +33,11 @@ | |
| 33 | ** System header files used by all modules |
| 34 | */ |
| 35 | #include <unistd.h> |
| 36 | #include <stdio.h> |
| 37 | #include <stdlib.h> |
| 38 | #include <ctype.h> |
| 39 | #include <string.h> |
| 40 | #include <stdarg.h> |
| 41 | #include <assert.h> |
| 42 | |
| 43 | #endif |
| 44 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -33,11 +33,11 @@ | |
| 33 | ** System header files used by all modules |
| 34 | */ |
| 35 | #include <unistd.h> |
| 36 | #include <stdio.h> |
| 37 | #include <stdlib.h> |
| 38 | /* #include <ctype.h> // do not use - causes problems */ |
| 39 | #include <string.h> |
| 40 | #include <stdarg.h> |
| 41 | #include <assert.h> |
| 42 | |
| 43 | #endif |
| 44 |
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -109,11 +109,11 @@ | ||
| 109 | 109 | /* Fill in the array */ |
| 110 | 110 | for(i=0; i<nLine; i++){ |
| 111 | 111 | a[i].z = z; |
| 112 | 112 | for(j=0; z[j] && z[j]!='\n'; j++){} |
| 113 | 113 | k = j; |
| 114 | - while( ignoreWS && k>0 && isspace(z[k-1]) ){ k--; } | |
| 114 | + while( ignoreWS && k>0 && fossil_isspace(z[k-1]) ){ k--; } | |
| 115 | 115 | for(h=0, x=0; x<k; x++){ |
| 116 | 116 | h = h ^ (h<<2) ^ z[x]; |
| 117 | 117 | } |
| 118 | 118 | a[i].h = h = (h<<LENGTH_MASK_SZ) | k;; |
| 119 | 119 | h2 = h % nLine; |
| 120 | 120 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -109,11 +109,11 @@ | |
| 109 | /* Fill in the array */ |
| 110 | for(i=0; i<nLine; i++){ |
| 111 | a[i].z = z; |
| 112 | for(j=0; z[j] && z[j]!='\n'; j++){} |
| 113 | k = j; |
| 114 | while( ignoreWS && k>0 && isspace(z[k-1]) ){ k--; } |
| 115 | for(h=0, x=0; x<k; x++){ |
| 116 | h = h ^ (h<<2) ^ z[x]; |
| 117 | } |
| 118 | a[i].h = h = (h<<LENGTH_MASK_SZ) | k;; |
| 119 | h2 = h % nLine; |
| 120 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -109,11 +109,11 @@ | |
| 109 | /* Fill in the array */ |
| 110 | for(i=0; i<nLine; i++){ |
| 111 | a[i].z = z; |
| 112 | for(j=0; z[j] && z[j]!='\n'; j++){} |
| 113 | k = j; |
| 114 | while( ignoreWS && k>0 && fossil_isspace(z[k-1]) ){ k--; } |
| 115 | for(h=0, x=0; x<k; x++){ |
| 116 | h = h ^ (h<<2) ^ z[x]; |
| 117 | } |
| 118 | a[i].h = h = (h<<LENGTH_MASK_SZ) | k;; |
| 119 | h2 = h % nLine; |
| 120 |
+1
-1
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -290,11 +290,11 @@ | ||
| 290 | 290 | if( zName[i]=='.' ) z = &zName[i+1]; |
| 291 | 291 | } |
| 292 | 292 | len = strlen(z); |
| 293 | 293 | if( len<sizeof(zSuffix)-1 ){ |
| 294 | 294 | strcpy(zSuffix, z); |
| 295 | - for(i=0; zSuffix[i]; i++) zSuffix[i] = tolower(zSuffix[i]); | |
| 295 | + for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]); | |
| 296 | 296 | first = 0; |
| 297 | 297 | last = sizeof(aMime)/sizeof(aMime[0]); |
| 298 | 298 | while( first<=last ){ |
| 299 | 299 | int c; |
| 300 | 300 | i = (first+last)/2; |
| 301 | 301 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -290,11 +290,11 @@ | |
| 290 | if( zName[i]=='.' ) z = &zName[i+1]; |
| 291 | } |
| 292 | len = strlen(z); |
| 293 | if( len<sizeof(zSuffix)-1 ){ |
| 294 | strcpy(zSuffix, z); |
| 295 | for(i=0; zSuffix[i]; i++) zSuffix[i] = tolower(zSuffix[i]); |
| 296 | first = 0; |
| 297 | last = sizeof(aMime)/sizeof(aMime[0]); |
| 298 | while( first<=last ){ |
| 299 | int c; |
| 300 | i = (first+last)/2; |
| 301 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -290,11 +290,11 @@ | |
| 290 | if( zName[i]=='.' ) z = &zName[i+1]; |
| 291 | } |
| 292 | len = strlen(z); |
| 293 | if( len<sizeof(zSuffix)-1 ){ |
| 294 | strcpy(zSuffix, z); |
| 295 | for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]); |
| 296 | first = 0; |
| 297 | last = sizeof(aMime)/sizeof(aMime[0]); |
| 298 | while( first<=last ){ |
| 299 | int c; |
| 300 | i = (first+last)/2; |
| 301 |
+2
-2
| --- src/encode.c | ||
| +++ src/encode.c | ||
| @@ -100,11 +100,11 @@ | ||
| 100 | 100 | int i = 0; |
| 101 | 101 | int count = 0; |
| 102 | 102 | char *zOut; |
| 103 | 103 | int other; |
| 104 | 104 | # define IsSafeChar(X) \ |
| 105 | - (isalnum(X) || (X)=='.' || (X)=='$' \ | |
| 105 | + (fossil_isalnum(X) || (X)=='.' || (X)=='$' \ | |
| 106 | 106 | || (X)=='~' || (X)=='-' || (X)=='_' || (X)==other) |
| 107 | 107 | |
| 108 | 108 | if( zIn==0 ) return 0; |
| 109 | 109 | if( n<0 ) n = strlen(zIn); |
| 110 | 110 | other = encodeSlash ? 'a' : '/'; |
| @@ -244,11 +244,11 @@ | ||
| 244 | 244 | zOut[j++] = '\\'; |
| 245 | 245 | zOut[j++] = '0'; |
| 246 | 246 | }else if( c=='\\' ){ |
| 247 | 247 | zOut[j++] = '\\'; |
| 248 | 248 | zOut[j++] = '\\'; |
| 249 | - }else if( isspace(c) ){ | |
| 249 | + }else if( fossil_isspace(c) ){ | |
| 250 | 250 | zOut[j++] = '\\'; |
| 251 | 251 | switch( c ){ |
| 252 | 252 | case '\n': c = 'n'; break; |
| 253 | 253 | case ' ': c = 's'; break; |
| 254 | 254 | case '\t': c = 't'; break; |
| 255 | 255 |
| --- src/encode.c | |
| +++ src/encode.c | |
| @@ -100,11 +100,11 @@ | |
| 100 | int i = 0; |
| 101 | int count = 0; |
| 102 | char *zOut; |
| 103 | int other; |
| 104 | # define IsSafeChar(X) \ |
| 105 | (isalnum(X) || (X)=='.' || (X)=='$' \ |
| 106 | || (X)=='~' || (X)=='-' || (X)=='_' || (X)==other) |
| 107 | |
| 108 | if( zIn==0 ) return 0; |
| 109 | if( n<0 ) n = strlen(zIn); |
| 110 | other = encodeSlash ? 'a' : '/'; |
| @@ -244,11 +244,11 @@ | |
| 244 | zOut[j++] = '\\'; |
| 245 | zOut[j++] = '0'; |
| 246 | }else if( c=='\\' ){ |
| 247 | zOut[j++] = '\\'; |
| 248 | zOut[j++] = '\\'; |
| 249 | }else if( isspace(c) ){ |
| 250 | zOut[j++] = '\\'; |
| 251 | switch( c ){ |
| 252 | case '\n': c = 'n'; break; |
| 253 | case ' ': c = 's'; break; |
| 254 | case '\t': c = 't'; break; |
| 255 |
| --- src/encode.c | |
| +++ src/encode.c | |
| @@ -100,11 +100,11 @@ | |
| 100 | int i = 0; |
| 101 | int count = 0; |
| 102 | char *zOut; |
| 103 | int other; |
| 104 | # define IsSafeChar(X) \ |
| 105 | (fossil_isalnum(X) || (X)=='.' || (X)=='$' \ |
| 106 | || (X)=='~' || (X)=='-' || (X)=='_' || (X)==other) |
| 107 | |
| 108 | if( zIn==0 ) return 0; |
| 109 | if( n<0 ) n = strlen(zIn); |
| 110 | other = encodeSlash ? 'a' : '/'; |
| @@ -244,11 +244,11 @@ | |
| 244 | zOut[j++] = '\\'; |
| 245 | zOut[j++] = '0'; |
| 246 | }else if( c=='\\' ){ |
| 247 | zOut[j++] = '\\'; |
| 248 | zOut[j++] = '\\'; |
| 249 | }else if( fossil_isspace(c) ){ |
| 250 | zOut[j++] = '\\'; |
| 251 | switch( c ){ |
| 252 | case '\n': c = 'n'; break; |
| 253 | case ' ': c = 's'; break; |
| 254 | case '\t': c = 't'; break; |
| 255 |
+2
-2
| --- src/event.c | ||
| +++ src/event.c | ||
| @@ -321,12 +321,12 @@ | ||
| 321 | 321 | |
| 322 | 322 | /* Collapse all sequences of whitespace and "," characters into |
| 323 | 323 | ** a single space character */ |
| 324 | 324 | zBlob = blob_str(&tags); |
| 325 | 325 | for(i=j=0; zBlob[i]; i++, j++){ |
| 326 | - if( blob_isspace(zBlob[i]) || zBlob[i]==',' ){ | |
| 327 | - while( blob_isspace(zBlob[i+1]) ){ i++; } | |
| 326 | + if( fossil_isspace(zBlob[i]) || zBlob[i]==',' ){ | |
| 327 | + while( fossil_isspace(zBlob[i+1]) ){ i++; } | |
| 328 | 328 | zBlob[j] = ' '; |
| 329 | 329 | }else{ |
| 330 | 330 | zBlob[j] = zBlob[i]; |
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | 333 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -321,12 +321,12 @@ | |
| 321 | |
| 322 | /* Collapse all sequences of whitespace and "," characters into |
| 323 | ** a single space character */ |
| 324 | zBlob = blob_str(&tags); |
| 325 | for(i=j=0; zBlob[i]; i++, j++){ |
| 326 | if( blob_isspace(zBlob[i]) || zBlob[i]==',' ){ |
| 327 | while( blob_isspace(zBlob[i+1]) ){ i++; } |
| 328 | zBlob[j] = ' '; |
| 329 | }else{ |
| 330 | zBlob[j] = zBlob[i]; |
| 331 | } |
| 332 | } |
| 333 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -321,12 +321,12 @@ | |
| 321 | |
| 322 | /* Collapse all sequences of whitespace and "," characters into |
| 323 | ** a single space character */ |
| 324 | zBlob = blob_str(&tags); |
| 325 | for(i=j=0; zBlob[i]; i++, j++){ |
| 326 | if( fossil_isspace(zBlob[i]) || zBlob[i]==',' ){ |
| 327 | while( fossil_isspace(zBlob[i+1]) ){ i++; } |
| 328 | zBlob[j] = ' '; |
| 329 | }else{ |
| 330 | zBlob[j] = zBlob[i]; |
| 331 | } |
| 332 | } |
| 333 |
+2
-2
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -210,15 +210,15 @@ | ||
| 210 | 210 | closeConnection = 1; |
| 211 | 211 | }else{ |
| 212 | 212 | closeConnection = 0; |
| 213 | 213 | } |
| 214 | 214 | }else if( strncasecmp(zLine, "content-length:", 15)==0 ){ |
| 215 | - for(i=15; isspace(zLine[i]); i++){} | |
| 215 | + for(i=15; fossil_isspace(zLine[i]); i++){} | |
| 216 | 216 | iLength = atoi(&zLine[i]); |
| 217 | 217 | }else if( strncasecmp(zLine, "connection:", 11)==0 ){ |
| 218 | 218 | char c; |
| 219 | - for(i=11; isspace(zLine[i]); i++){} | |
| 219 | + for(i=11; fossil_isspace(zLine[i]); i++){} | |
| 220 | 220 | c = zLine[i]; |
| 221 | 221 | if( c=='c' || c=='C' ){ |
| 222 | 222 | closeConnection = 1; |
| 223 | 223 | }else if( c=='k' || c=='K' ){ |
| 224 | 224 | closeConnection = 0; |
| 225 | 225 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -210,15 +210,15 @@ | |
| 210 | closeConnection = 1; |
| 211 | }else{ |
| 212 | closeConnection = 0; |
| 213 | } |
| 214 | }else if( strncasecmp(zLine, "content-length:", 15)==0 ){ |
| 215 | for(i=15; isspace(zLine[i]); i++){} |
| 216 | iLength = atoi(&zLine[i]); |
| 217 | }else if( strncasecmp(zLine, "connection:", 11)==0 ){ |
| 218 | char c; |
| 219 | for(i=11; isspace(zLine[i]); i++){} |
| 220 | c = zLine[i]; |
| 221 | if( c=='c' || c=='C' ){ |
| 222 | closeConnection = 1; |
| 223 | }else if( c=='k' || c=='K' ){ |
| 224 | closeConnection = 0; |
| 225 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -210,15 +210,15 @@ | |
| 210 | closeConnection = 1; |
| 211 | }else{ |
| 212 | closeConnection = 0; |
| 213 | } |
| 214 | }else if( strncasecmp(zLine, "content-length:", 15)==0 ){ |
| 215 | for(i=15; fossil_isspace(zLine[i]); i++){} |
| 216 | iLength = atoi(&zLine[i]); |
| 217 | }else if( strncasecmp(zLine, "connection:", 11)==0 ){ |
| 218 | char c; |
| 219 | for(i=11; fossil_isspace(zLine[i]); i++){} |
| 220 | c = zLine[i]; |
| 221 | if( c=='c' || c=='C' ){ |
| 222 | closeConnection = 1; |
| 223 | }else if( c=='k' || c=='K' ){ |
| 224 | closeConnection = 0; |
| 225 |
+2
-2
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -83,11 +83,11 @@ | ||
| 83 | 83 | int got; |
| 84 | 84 | zBuf[0] = 0; |
| 85 | 85 | got = read(sshIn, zBuf, szBuf-1); |
| 86 | 86 | while( got>=0 ){ |
| 87 | 87 | zBuf[got] = 0; |
| 88 | - if( got==0 || !isspace(zBuf[got-1]) ) break; | |
| 88 | + if( got==0 || !fossil_isspace(zBuf[got-1]) ) break; | |
| 89 | 89 | got--; |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /* |
| @@ -439,11 +439,11 @@ | ||
| 439 | 439 | break; |
| 440 | 440 | } |
| 441 | 441 | } |
| 442 | 442 | if( transport.pBuf[i]=='\n' ){ |
| 443 | 443 | transport.iCursor = i+1; |
| 444 | - while( i>=iStart && isspace(transport.pBuf[i]) ){ | |
| 444 | + while( i>=iStart && fossil_isspace(transport.pBuf[i]) ){ | |
| 445 | 445 | transport.pBuf[i] = 0; |
| 446 | 446 | i--; |
| 447 | 447 | } |
| 448 | 448 | break; |
| 449 | 449 | } |
| 450 | 450 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -83,11 +83,11 @@ | |
| 83 | int got; |
| 84 | zBuf[0] = 0; |
| 85 | got = read(sshIn, zBuf, szBuf-1); |
| 86 | while( got>=0 ){ |
| 87 | zBuf[got] = 0; |
| 88 | if( got==0 || !isspace(zBuf[got-1]) ) break; |
| 89 | got--; |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | /* |
| @@ -439,11 +439,11 @@ | |
| 439 | break; |
| 440 | } |
| 441 | } |
| 442 | if( transport.pBuf[i]=='\n' ){ |
| 443 | transport.iCursor = i+1; |
| 444 | while( i>=iStart && isspace(transport.pBuf[i]) ){ |
| 445 | transport.pBuf[i] = 0; |
| 446 | i--; |
| 447 | } |
| 448 | break; |
| 449 | } |
| 450 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -83,11 +83,11 @@ | |
| 83 | int got; |
| 84 | zBuf[0] = 0; |
| 85 | got = read(sshIn, zBuf, szBuf-1); |
| 86 | while( got>=0 ){ |
| 87 | zBuf[got] = 0; |
| 88 | if( got==0 || !fossil_isspace(zBuf[got-1]) ) break; |
| 89 | got--; |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | /* |
| @@ -439,11 +439,11 @@ | |
| 439 | break; |
| 440 | } |
| 441 | } |
| 442 | if( transport.pBuf[i]=='\n' ){ |
| 443 | transport.iCursor = i+1; |
| 444 | while( i>=iStart && fossil_isspace(transport.pBuf[i]) ){ |
| 445 | transport.pBuf[i] = 0; |
| 446 | i--; |
| 447 | } |
| 448 | break; |
| 449 | } |
| 450 |
+1
-1
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -353,11 +353,11 @@ | ||
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | /* Check the login cookie to see if it matches a known valid user. |
| 356 | 356 | */ |
| 357 | 357 | if( uid==0 && (zCookie = P(login_cookie_name()))!=0 ){ |
| 358 | - if( isdigit(zCookie[0]) ){ | |
| 358 | + if( fossil_isdigit(zCookie[0]) ){ | |
| 359 | 359 | /* Cookies of the form "uid/randomness". There must be a |
| 360 | 360 | ** corresponding entry in the user table. */ |
| 361 | 361 | uid = db_int(0, |
| 362 | 362 | "SELECT uid FROM user" |
| 363 | 363 | " WHERE uid=%d" |
| 364 | 364 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -353,11 +353,11 @@ | |
| 353 | } |
| 354 | |
| 355 | /* Check the login cookie to see if it matches a known valid user. |
| 356 | */ |
| 357 | if( uid==0 && (zCookie = P(login_cookie_name()))!=0 ){ |
| 358 | if( isdigit(zCookie[0]) ){ |
| 359 | /* Cookies of the form "uid/randomness". There must be a |
| 360 | ** corresponding entry in the user table. */ |
| 361 | uid = db_int(0, |
| 362 | "SELECT uid FROM user" |
| 363 | " WHERE uid=%d" |
| 364 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -353,11 +353,11 @@ | |
| 353 | } |
| 354 | |
| 355 | /* Check the login cookie to see if it matches a known valid user. |
| 356 | */ |
| 357 | if( uid==0 && (zCookie = P(login_cookie_name()))!=0 ){ |
| 358 | if( fossil_isdigit(zCookie[0]) ){ |
| 359 | /* Cookies of the form "uid/randomness". There must be a |
| 360 | ** corresponding entry in the user table. */ |
| 361 | uid = db_int(0, |
| 362 | "SELECT uid FROM user" |
| 363 | " WHERE uid=%d" |
| 364 |
+1
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -757,11 +757,11 @@ | ||
| 757 | 757 | |
| 758 | 758 | /* To avoid mischief, make sure the repository basename contains no |
| 759 | 759 | ** characters other than alphanumerics, "-", and "_". |
| 760 | 760 | */ |
| 761 | 761 | for(j=strlen(g.zRepositoryName)+1, k=0; k<i-1; j++, k++){ |
| 762 | - if( !isalnum(zRepo[j]) && zRepo[j]!='-' ) zRepo[j] = '_'; | |
| 762 | + if( !fossil_isalnum(zRepo[j]) && zRepo[j]!='-' ) zRepo[j] = '_'; | |
| 763 | 763 | } |
| 764 | 764 | if( zRepo[0]=='/' && zRepo[1]=='/' ) zRepo++; |
| 765 | 765 | |
| 766 | 766 | if( file_size(zRepo)<1024 ){ |
| 767 | 767 | if( zNotFound ){ |
| 768 | 768 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -757,11 +757,11 @@ | |
| 757 | |
| 758 | /* To avoid mischief, make sure the repository basename contains no |
| 759 | ** characters other than alphanumerics, "-", and "_". |
| 760 | */ |
| 761 | for(j=strlen(g.zRepositoryName)+1, k=0; k<i-1; j++, k++){ |
| 762 | if( !isalnum(zRepo[j]) && zRepo[j]!='-' ) zRepo[j] = '_'; |
| 763 | } |
| 764 | if( zRepo[0]=='/' && zRepo[1]=='/' ) zRepo++; |
| 765 | |
| 766 | if( file_size(zRepo)<1024 ){ |
| 767 | if( zNotFound ){ |
| 768 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -757,11 +757,11 @@ | |
| 757 | |
| 758 | /* To avoid mischief, make sure the repository basename contains no |
| 759 | ** characters other than alphanumerics, "-", and "_". |
| 760 | */ |
| 761 | for(j=strlen(g.zRepositoryName)+1, k=0; k<i-1; j++, k++){ |
| 762 | if( !fossil_isalnum(zRepo[j]) && zRepo[j]!='-' ) zRepo[j] = '_'; |
| 763 | } |
| 764 | if( zRepo[0]=='/' && zRepo[1]=='/' ) zRepo++; |
| 765 | |
| 766 | if( file_size(zRepo)<1024 ){ |
| 767 | if( zNotFound ){ |
| 768 |
+2
-2
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1211,11 +1211,11 @@ | ||
| 1211 | 1211 | int tagid = tag_findid(zTag, 1); |
| 1212 | 1212 | int prior; |
| 1213 | 1213 | char *zComment; |
| 1214 | 1214 | int nWiki; |
| 1215 | 1215 | char zLength[40]; |
| 1216 | - while( isspace(m.zWiki[0]) ) m.zWiki++; | |
| 1216 | + while( fossil_isspace(m.zWiki[0]) ) m.zWiki++; | |
| 1217 | 1217 | nWiki = strlen(m.zWiki); |
| 1218 | 1218 | sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki); |
| 1219 | 1219 | tag_insert(zTag, 1, zLength, rid, m.rDate, rid); |
| 1220 | 1220 | free(zTag); |
| 1221 | 1221 | prior = db_int(0, |
| @@ -1251,11 +1251,11 @@ | ||
| 1251 | 1251 | char *zTag = mprintf("event-%s", m.zEventId); |
| 1252 | 1252 | int tagid = tag_findid(zTag, 1); |
| 1253 | 1253 | int prior, subsequent; |
| 1254 | 1254 | int nWiki; |
| 1255 | 1255 | char zLength[40]; |
| 1256 | - while( isspace(m.zWiki[0]) ) m.zWiki++; | |
| 1256 | + while( fossil_isspace(m.zWiki[0]) ) m.zWiki++; | |
| 1257 | 1257 | nWiki = strlen(m.zWiki); |
| 1258 | 1258 | sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki); |
| 1259 | 1259 | tag_insert(zTag, 1, zLength, rid, m.rDate, rid); |
| 1260 | 1260 | free(zTag); |
| 1261 | 1261 | prior = db_int(0, |
| 1262 | 1262 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1211,11 +1211,11 @@ | |
| 1211 | int tagid = tag_findid(zTag, 1); |
| 1212 | int prior; |
| 1213 | char *zComment; |
| 1214 | int nWiki; |
| 1215 | char zLength[40]; |
| 1216 | while( isspace(m.zWiki[0]) ) m.zWiki++; |
| 1217 | nWiki = strlen(m.zWiki); |
| 1218 | sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki); |
| 1219 | tag_insert(zTag, 1, zLength, rid, m.rDate, rid); |
| 1220 | free(zTag); |
| 1221 | prior = db_int(0, |
| @@ -1251,11 +1251,11 @@ | |
| 1251 | char *zTag = mprintf("event-%s", m.zEventId); |
| 1252 | int tagid = tag_findid(zTag, 1); |
| 1253 | int prior, subsequent; |
| 1254 | int nWiki; |
| 1255 | char zLength[40]; |
| 1256 | while( isspace(m.zWiki[0]) ) m.zWiki++; |
| 1257 | nWiki = strlen(m.zWiki); |
| 1258 | sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki); |
| 1259 | tag_insert(zTag, 1, zLength, rid, m.rDate, rid); |
| 1260 | free(zTag); |
| 1261 | prior = db_int(0, |
| 1262 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1211,11 +1211,11 @@ | |
| 1211 | int tagid = tag_findid(zTag, 1); |
| 1212 | int prior; |
| 1213 | char *zComment; |
| 1214 | int nWiki; |
| 1215 | char zLength[40]; |
| 1216 | while( fossil_isspace(m.zWiki[0]) ) m.zWiki++; |
| 1217 | nWiki = strlen(m.zWiki); |
| 1218 | sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki); |
| 1219 | tag_insert(zTag, 1, zLength, rid, m.rDate, rid); |
| 1220 | free(zTag); |
| 1221 | prior = db_int(0, |
| @@ -1251,11 +1251,11 @@ | |
| 1251 | char *zTag = mprintf("event-%s", m.zEventId); |
| 1252 | int tagid = tag_findid(zTag, 1); |
| 1253 | int prior, subsequent; |
| 1254 | int nWiki; |
| 1255 | char zLength[40]; |
| 1256 | while( fossil_isspace(m.zWiki[0]) ) m.zWiki++; |
| 1257 | nWiki = strlen(m.zWiki); |
| 1258 | sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki); |
| 1259 | tag_insert(zTag, 1, zLength, rid, m.rDate, rid); |
| 1260 | free(zTag); |
| 1261 | prior = db_int(0, |
| 1262 |
+10
-10
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -111,20 +111,20 @@ | ||
| 111 | 111 | |
| 112 | 112 | /* |
| 113 | 113 | ** Return TRUE if the string begins with an ISO8601 date: YYYY-MM-DD. |
| 114 | 114 | */ |
| 115 | 115 | static int is_date(const char *z){ |
| 116 | - if( !isdigit(z[0]) ) return 0; | |
| 117 | - if( !isdigit(z[1]) ) return 0; | |
| 118 | - if( !isdigit(z[2]) ) return 0; | |
| 119 | - if( !isdigit(z[3]) ) return 0; | |
| 116 | + if( !fossil_isdigit(z[0]) ) return 0; | |
| 117 | + if( !fossil_isdigit(z[1]) ) return 0; | |
| 118 | + if( !fossil_isdigit(z[2]) ) return 0; | |
| 119 | + if( !fossil_isdigit(z[3]) ) return 0; | |
| 120 | 120 | if( z[4]!='-') return 0; |
| 121 | - if( !isdigit(z[5]) ) return 0; | |
| 122 | - if( !isdigit(z[6]) ) return 0; | |
| 121 | + if( !fossil_isdigit(z[5]) ) return 0; | |
| 122 | + if( !fossil_isdigit(z[6]) ) return 0; | |
| 123 | 123 | if( z[7]!='-') return 0; |
| 124 | - if( !isdigit(z[8]) ) return 0; | |
| 125 | - if( !isdigit(z[9]) ) return 0; | |
| 124 | + if( !fossil_isdigit(z[8]) ) return 0; | |
| 125 | + if( !fossil_isdigit(z[9]) ) return 0; | |
| 126 | 126 | return 1; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /* |
| 130 | 130 | ** Convert a symbolic tag name into the UUID of a check-in that contains |
| @@ -280,11 +280,11 @@ | ||
| 280 | 280 | |
| 281 | 281 | if( zName==0 || zName[0]==0 ) return 0; |
| 282 | 282 | blob_init(&name, zName, -1); |
| 283 | 283 | if( name_to_uuid(&name, -1) ){ |
| 284 | 284 | blob_reset(&name); |
| 285 | - for(i=0; zName[i] && isdigit(zName[i]); i++){} | |
| 285 | + for(i=0; zName[i] && fossil_isdigit(zName[i]); i++){} | |
| 286 | 286 | if( zName[i]==0 ){ |
| 287 | 287 | rid = atoi(zName); |
| 288 | 288 | if( db_exists("SELECT 1 FROM blob WHERE rid=%d", rid) ){ |
| 289 | 289 | return rid; |
| 290 | 290 | } |
| @@ -348,11 +348,11 @@ | ||
| 348 | 348 | if( zName==0 || zName[0]==0 ) return 0; |
| 349 | 349 | blob_init(&name, zName, -1); |
| 350 | 350 | rc = name_to_uuid(&name, -1); |
| 351 | 351 | if( rc==1 ){ |
| 352 | 352 | blob_reset(&name); |
| 353 | - for(i=0; zName[i] && isdigit(zName[i]); i++){} | |
| 353 | + for(i=0; zName[i] && fossil_isdigit(zName[i]); i++){} | |
| 354 | 354 | if( zName[i]==0 ){ |
| 355 | 355 | rid = atoi(zName); |
| 356 | 356 | if( db_exists("SELECT 1 FROM blob WHERE rid=%d", rid) ){ |
| 357 | 357 | return rid; |
| 358 | 358 | } |
| 359 | 359 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -111,20 +111,20 @@ | |
| 111 | |
| 112 | /* |
| 113 | ** Return TRUE if the string begins with an ISO8601 date: YYYY-MM-DD. |
| 114 | */ |
| 115 | static int is_date(const char *z){ |
| 116 | if( !isdigit(z[0]) ) return 0; |
| 117 | if( !isdigit(z[1]) ) return 0; |
| 118 | if( !isdigit(z[2]) ) return 0; |
| 119 | if( !isdigit(z[3]) ) return 0; |
| 120 | if( z[4]!='-') return 0; |
| 121 | if( !isdigit(z[5]) ) return 0; |
| 122 | if( !isdigit(z[6]) ) return 0; |
| 123 | if( z[7]!='-') return 0; |
| 124 | if( !isdigit(z[8]) ) return 0; |
| 125 | if( !isdigit(z[9]) ) return 0; |
| 126 | return 1; |
| 127 | } |
| 128 | |
| 129 | /* |
| 130 | ** Convert a symbolic tag name into the UUID of a check-in that contains |
| @@ -280,11 +280,11 @@ | |
| 280 | |
| 281 | if( zName==0 || zName[0]==0 ) return 0; |
| 282 | blob_init(&name, zName, -1); |
| 283 | if( name_to_uuid(&name, -1) ){ |
| 284 | blob_reset(&name); |
| 285 | for(i=0; zName[i] && isdigit(zName[i]); i++){} |
| 286 | if( zName[i]==0 ){ |
| 287 | rid = atoi(zName); |
| 288 | if( db_exists("SELECT 1 FROM blob WHERE rid=%d", rid) ){ |
| 289 | return rid; |
| 290 | } |
| @@ -348,11 +348,11 @@ | |
| 348 | if( zName==0 || zName[0]==0 ) return 0; |
| 349 | blob_init(&name, zName, -1); |
| 350 | rc = name_to_uuid(&name, -1); |
| 351 | if( rc==1 ){ |
| 352 | blob_reset(&name); |
| 353 | for(i=0; zName[i] && isdigit(zName[i]); i++){} |
| 354 | if( zName[i]==0 ){ |
| 355 | rid = atoi(zName); |
| 356 | if( db_exists("SELECT 1 FROM blob WHERE rid=%d", rid) ){ |
| 357 | return rid; |
| 358 | } |
| 359 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -111,20 +111,20 @@ | |
| 111 | |
| 112 | /* |
| 113 | ** Return TRUE if the string begins with an ISO8601 date: YYYY-MM-DD. |
| 114 | */ |
| 115 | static int is_date(const char *z){ |
| 116 | if( !fossil_isdigit(z[0]) ) return 0; |
| 117 | if( !fossil_isdigit(z[1]) ) return 0; |
| 118 | if( !fossil_isdigit(z[2]) ) return 0; |
| 119 | if( !fossil_isdigit(z[3]) ) return 0; |
| 120 | if( z[4]!='-') return 0; |
| 121 | if( !fossil_isdigit(z[5]) ) return 0; |
| 122 | if( !fossil_isdigit(z[6]) ) return 0; |
| 123 | if( z[7]!='-') return 0; |
| 124 | if( !fossil_isdigit(z[8]) ) return 0; |
| 125 | if( !fossil_isdigit(z[9]) ) return 0; |
| 126 | return 1; |
| 127 | } |
| 128 | |
| 129 | /* |
| 130 | ** Convert a symbolic tag name into the UUID of a check-in that contains |
| @@ -280,11 +280,11 @@ | |
| 280 | |
| 281 | if( zName==0 || zName[0]==0 ) return 0; |
| 282 | blob_init(&name, zName, -1); |
| 283 | if( name_to_uuid(&name, -1) ){ |
| 284 | blob_reset(&name); |
| 285 | for(i=0; zName[i] && fossil_isdigit(zName[i]); i++){} |
| 286 | if( zName[i]==0 ){ |
| 287 | rid = atoi(zName); |
| 288 | if( db_exists("SELECT 1 FROM blob WHERE rid=%d", rid) ){ |
| 289 | return rid; |
| 290 | } |
| @@ -348,11 +348,11 @@ | |
| 348 | if( zName==0 || zName[0]==0 ) return 0; |
| 349 | blob_init(&name, zName, -1); |
| 350 | rc = name_to_uuid(&name, -1); |
| 351 | if( rc==1 ){ |
| 352 | blob_reset(&name); |
| 353 | for(i=0; zName[i] && fossil_isdigit(zName[i]); i++){} |
| 354 | if( zName[i]==0 ){ |
| 355 | rid = atoi(zName); |
| 356 | if( db_exists("SELECT 1 FROM blob WHERE rid=%d", rid) ){ |
| 357 | return rid; |
| 358 | } |
| 359 |
+16
-16
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -88,22 +88,22 @@ | ||
| 88 | 88 | /* |
| 89 | 89 | ** Remove whitespace from both ends of a string. |
| 90 | 90 | */ |
| 91 | 91 | char *trim_string(const char *zOrig){ |
| 92 | 92 | int i; |
| 93 | - while( isspace(*zOrig) ){ zOrig++; } | |
| 93 | + while( fossil_isspace(*zOrig) ){ zOrig++; } | |
| 94 | 94 | i = strlen(zOrig); |
| 95 | - while( i>0 && isspace(zOrig[i-1]) ){ i--; } | |
| 95 | + while( i>0 && fossil_isspace(zOrig[i-1]) ){ i--; } | |
| 96 | 96 | return mprintf("%.*s", i, zOrig); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /* |
| 100 | 100 | ** Extract a numeric (integer) value from a string. |
| 101 | 101 | */ |
| 102 | 102 | char *extract_integer(const char *zOrig){ |
| 103 | 103 | if( zOrig == NULL || zOrig[0] == 0 ) return ""; |
| 104 | - while( *zOrig && !isdigit(*zOrig) ){ zOrig++; } | |
| 104 | + while( *zOrig && !fossil_isdigit(*zOrig) ){ zOrig++; } | |
| 105 | 105 | if( *zOrig ){ |
| 106 | 106 | /* we have a digit. atoi() will get as much of the number as it |
| 107 | 107 | ** can. We'll run it through mprintf() to get a string. Not |
| 108 | 108 | ** an efficient way to do it, but effective. |
| 109 | 109 | */ |
| @@ -118,18 +118,18 @@ | ||
| 118 | 118 | ** which also converts any CRNL sequence into a single NL. |
| 119 | 119 | */ |
| 120 | 120 | char *remove_blank_lines(const char *zOrig){ |
| 121 | 121 | int i, j, n; |
| 122 | 122 | char *z; |
| 123 | - for(i=j=0; isspace(zOrig[i]); i++){ if( zOrig[i]=='\n' ) j = i+1; } | |
| 123 | + for(i=j=0; fossil_isspace(zOrig[i]); i++){ if( zOrig[i]=='\n' ) j = i+1; } | |
| 124 | 124 | n = strlen(&zOrig[j]); |
| 125 | - while( n>0 && isspace(zOrig[j+n-1]) ){ n--; } | |
| 125 | + while( n>0 && fossil_isspace(zOrig[j+n-1]) ){ n--; } | |
| 126 | 126 | z = mprintf("%.*s", n, &zOrig[j]); |
| 127 | 127 | for(i=j=0; z[i]; i++){ |
| 128 | - if( z[i+1]=='\n' && z[i]!='\n' && isspace(z[i]) ){ | |
| 128 | + if( z[i+1]=='\n' && z[i]!='\n' && fossil_isspace(z[i]) ){ | |
| 129 | 129 | z[j] = z[i]; |
| 130 | - while(isspace(z[j]) && z[j] != '\n' ){ j--; } | |
| 130 | + while(fossil_isspace(z[j]) && z[j] != '\n' ){ j--; } | |
| 131 | 131 | j++; |
| 132 | 132 | continue; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | z[j++] = z[i]; |
| @@ -212,11 +212,11 @@ | ||
| 212 | 212 | int rc; |
| 213 | 213 | |
| 214 | 214 | /* First make sure the SQL is a single query command by verifying that |
| 215 | 215 | ** the first token is "SELECT" and that there are no unquoted semicolons. |
| 216 | 216 | */ |
| 217 | - for(i=0; isspace(zSql[i]); i++){} | |
| 217 | + for(i=0; fossil_isspace(zSql[i]); i++){} | |
| 218 | 218 | if( strncasecmp(&zSql[i],"select",6)!=0 ){ |
| 219 | 219 | return mprintf("The SQL must be a SELECT statement"); |
| 220 | 220 | } |
| 221 | 221 | for(i=0; zSql[i]; i++){ |
| 222 | 222 | if( zSql[i]==';' ){ |
| @@ -743,15 +743,15 @@ | ||
| 743 | 743 | ** spaces. |
| 744 | 744 | */ |
| 745 | 745 | static void output_no_tabs(const char *z){ |
| 746 | 746 | while( z && z[0] ){ |
| 747 | 747 | int i, j; |
| 748 | - for(i=0; z[i] && (!isspace(z[i]) || z[i]==' '); i++){} | |
| 748 | + for(i=0; z[i] && (!fossil_isspace(z[i]) || z[i]==' '); i++){} | |
| 749 | 749 | if( i>0 ){ |
| 750 | 750 | cgi_printf("%.*s", i, z); |
| 751 | 751 | } |
| 752 | - for(j=i; isspace(z[j]); j++){} | |
| 752 | + for(j=i; fossil_isspace(z[j]); j++){} | |
| 753 | 753 | if( j>i ){ |
| 754 | 754 | cgi_printf("%*s", j-i, ""); |
| 755 | 755 | } |
| 756 | 756 | z += j; |
| 757 | 757 | } |
| @@ -787,21 +787,21 @@ | ||
| 787 | 787 | ** Generate HTML that describes a color key. |
| 788 | 788 | */ |
| 789 | 789 | void output_color_key(const char *zClrKey, int horiz, char *zTabArgs){ |
| 790 | 790 | int i, j, k; |
| 791 | 791 | char *zSafeKey, *zToFree; |
| 792 | - while( isspace(*zClrKey) ) zClrKey++; | |
| 792 | + while( fossil_isspace(*zClrKey) ) zClrKey++; | |
| 793 | 793 | if( zClrKey[0]==0 ) return; |
| 794 | 794 | @ <table %s(zTabArgs)> |
| 795 | 795 | if( horiz ){ |
| 796 | 796 | @ <tr> |
| 797 | 797 | } |
| 798 | 798 | zToFree = zSafeKey = mprintf("%h", zClrKey); |
| 799 | 799 | while( zSafeKey[0] ){ |
| 800 | - while( isspace(*zSafeKey) ) zSafeKey++; | |
| 801 | - for(i=0; zSafeKey[i] && !isspace(zSafeKey[i]); i++){} | |
| 802 | - for(j=i; isspace(zSafeKey[j]); j++){} | |
| 800 | + while( fossil_isspace(*zSafeKey) ) zSafeKey++; | |
| 801 | + for(i=0; zSafeKey[i] && !fossil_isspace(zSafeKey[i]); i++){} | |
| 802 | + for(j=i; fossil_isspace(zSafeKey[j]); j++){} | |
| 803 | 803 | for(k=j; zSafeKey[k] && zSafeKey[k]!='\n' && zSafeKey[k]!='\r'; k++){} |
| 804 | 804 | if( !horiz ){ |
| 805 | 805 | cgi_printf("<tr style=\"background-color: %.*s;\"><td>%.*s</td></tr>\n", |
| 806 | 806 | i, zSafeKey, k-j, &zSafeKey[j]); |
| 807 | 807 | }else{ |
| @@ -977,15 +977,15 @@ | ||
| 977 | 977 | break; |
| 978 | 978 | } |
| 979 | 979 | default: |
| 980 | 980 | while( z && z[0] ){ |
| 981 | 981 | int i, j; |
| 982 | - for(i=0; z[i] && (!isspace(z[i]) || z[i]==' '); i++){} | |
| 982 | + for(i=0; z[i] && (!fossil_isspace(z[i]) || z[i]==' '); i++){} | |
| 983 | 983 | if( i>0 ){ |
| 984 | 984 | printf("%.*s", i, z); |
| 985 | 985 | } |
| 986 | - for(j=i; isspace(z[j]); j++){} | |
| 986 | + for(j=i; fossil_isspace(z[j]); j++){} | |
| 987 | 987 | if( j>i ){ |
| 988 | 988 | printf("%*s", j-i, ""); |
| 989 | 989 | } |
| 990 | 990 | z += j; |
| 991 | 991 | } |
| 992 | 992 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -88,22 +88,22 @@ | |
| 88 | /* |
| 89 | ** Remove whitespace from both ends of a string. |
| 90 | */ |
| 91 | char *trim_string(const char *zOrig){ |
| 92 | int i; |
| 93 | while( isspace(*zOrig) ){ zOrig++; } |
| 94 | i = strlen(zOrig); |
| 95 | while( i>0 && isspace(zOrig[i-1]) ){ i--; } |
| 96 | return mprintf("%.*s", i, zOrig); |
| 97 | } |
| 98 | |
| 99 | /* |
| 100 | ** Extract a numeric (integer) value from a string. |
| 101 | */ |
| 102 | char *extract_integer(const char *zOrig){ |
| 103 | if( zOrig == NULL || zOrig[0] == 0 ) return ""; |
| 104 | while( *zOrig && !isdigit(*zOrig) ){ zOrig++; } |
| 105 | if( *zOrig ){ |
| 106 | /* we have a digit. atoi() will get as much of the number as it |
| 107 | ** can. We'll run it through mprintf() to get a string. Not |
| 108 | ** an efficient way to do it, but effective. |
| 109 | */ |
| @@ -118,18 +118,18 @@ | |
| 118 | ** which also converts any CRNL sequence into a single NL. |
| 119 | */ |
| 120 | char *remove_blank_lines(const char *zOrig){ |
| 121 | int i, j, n; |
| 122 | char *z; |
| 123 | for(i=j=0; isspace(zOrig[i]); i++){ if( zOrig[i]=='\n' ) j = i+1; } |
| 124 | n = strlen(&zOrig[j]); |
| 125 | while( n>0 && isspace(zOrig[j+n-1]) ){ n--; } |
| 126 | z = mprintf("%.*s", n, &zOrig[j]); |
| 127 | for(i=j=0; z[i]; i++){ |
| 128 | if( z[i+1]=='\n' && z[i]!='\n' && isspace(z[i]) ){ |
| 129 | z[j] = z[i]; |
| 130 | while(isspace(z[j]) && z[j] != '\n' ){ j--; } |
| 131 | j++; |
| 132 | continue; |
| 133 | } |
| 134 | |
| 135 | z[j++] = z[i]; |
| @@ -212,11 +212,11 @@ | |
| 212 | int rc; |
| 213 | |
| 214 | /* First make sure the SQL is a single query command by verifying that |
| 215 | ** the first token is "SELECT" and that there are no unquoted semicolons. |
| 216 | */ |
| 217 | for(i=0; isspace(zSql[i]); i++){} |
| 218 | if( strncasecmp(&zSql[i],"select",6)!=0 ){ |
| 219 | return mprintf("The SQL must be a SELECT statement"); |
| 220 | } |
| 221 | for(i=0; zSql[i]; i++){ |
| 222 | if( zSql[i]==';' ){ |
| @@ -743,15 +743,15 @@ | |
| 743 | ** spaces. |
| 744 | */ |
| 745 | static void output_no_tabs(const char *z){ |
| 746 | while( z && z[0] ){ |
| 747 | int i, j; |
| 748 | for(i=0; z[i] && (!isspace(z[i]) || z[i]==' '); i++){} |
| 749 | if( i>0 ){ |
| 750 | cgi_printf("%.*s", i, z); |
| 751 | } |
| 752 | for(j=i; isspace(z[j]); j++){} |
| 753 | if( j>i ){ |
| 754 | cgi_printf("%*s", j-i, ""); |
| 755 | } |
| 756 | z += j; |
| 757 | } |
| @@ -787,21 +787,21 @@ | |
| 787 | ** Generate HTML that describes a color key. |
| 788 | */ |
| 789 | void output_color_key(const char *zClrKey, int horiz, char *zTabArgs){ |
| 790 | int i, j, k; |
| 791 | char *zSafeKey, *zToFree; |
| 792 | while( isspace(*zClrKey) ) zClrKey++; |
| 793 | if( zClrKey[0]==0 ) return; |
| 794 | @ <table %s(zTabArgs)> |
| 795 | if( horiz ){ |
| 796 | @ <tr> |
| 797 | } |
| 798 | zToFree = zSafeKey = mprintf("%h", zClrKey); |
| 799 | while( zSafeKey[0] ){ |
| 800 | while( isspace(*zSafeKey) ) zSafeKey++; |
| 801 | for(i=0; zSafeKey[i] && !isspace(zSafeKey[i]); i++){} |
| 802 | for(j=i; isspace(zSafeKey[j]); j++){} |
| 803 | for(k=j; zSafeKey[k] && zSafeKey[k]!='\n' && zSafeKey[k]!='\r'; k++){} |
| 804 | if( !horiz ){ |
| 805 | cgi_printf("<tr style=\"background-color: %.*s;\"><td>%.*s</td></tr>\n", |
| 806 | i, zSafeKey, k-j, &zSafeKey[j]); |
| 807 | }else{ |
| @@ -977,15 +977,15 @@ | |
| 977 | break; |
| 978 | } |
| 979 | default: |
| 980 | while( z && z[0] ){ |
| 981 | int i, j; |
| 982 | for(i=0; z[i] && (!isspace(z[i]) || z[i]==' '); i++){} |
| 983 | if( i>0 ){ |
| 984 | printf("%.*s", i, z); |
| 985 | } |
| 986 | for(j=i; isspace(z[j]); j++){} |
| 987 | if( j>i ){ |
| 988 | printf("%*s", j-i, ""); |
| 989 | } |
| 990 | z += j; |
| 991 | } |
| 992 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -88,22 +88,22 @@ | |
| 88 | /* |
| 89 | ** Remove whitespace from both ends of a string. |
| 90 | */ |
| 91 | char *trim_string(const char *zOrig){ |
| 92 | int i; |
| 93 | while( fossil_isspace(*zOrig) ){ zOrig++; } |
| 94 | i = strlen(zOrig); |
| 95 | while( i>0 && fossil_isspace(zOrig[i-1]) ){ i--; } |
| 96 | return mprintf("%.*s", i, zOrig); |
| 97 | } |
| 98 | |
| 99 | /* |
| 100 | ** Extract a numeric (integer) value from a string. |
| 101 | */ |
| 102 | char *extract_integer(const char *zOrig){ |
| 103 | if( zOrig == NULL || zOrig[0] == 0 ) return ""; |
| 104 | while( *zOrig && !fossil_isdigit(*zOrig) ){ zOrig++; } |
| 105 | if( *zOrig ){ |
| 106 | /* we have a digit. atoi() will get as much of the number as it |
| 107 | ** can. We'll run it through mprintf() to get a string. Not |
| 108 | ** an efficient way to do it, but effective. |
| 109 | */ |
| @@ -118,18 +118,18 @@ | |
| 118 | ** which also converts any CRNL sequence into a single NL. |
| 119 | */ |
| 120 | char *remove_blank_lines(const char *zOrig){ |
| 121 | int i, j, n; |
| 122 | char *z; |
| 123 | for(i=j=0; fossil_isspace(zOrig[i]); i++){ if( zOrig[i]=='\n' ) j = i+1; } |
| 124 | n = strlen(&zOrig[j]); |
| 125 | while( n>0 && fossil_isspace(zOrig[j+n-1]) ){ n--; } |
| 126 | z = mprintf("%.*s", n, &zOrig[j]); |
| 127 | for(i=j=0; z[i]; i++){ |
| 128 | if( z[i+1]=='\n' && z[i]!='\n' && fossil_isspace(z[i]) ){ |
| 129 | z[j] = z[i]; |
| 130 | while(fossil_isspace(z[j]) && z[j] != '\n' ){ j--; } |
| 131 | j++; |
| 132 | continue; |
| 133 | } |
| 134 | |
| 135 | z[j++] = z[i]; |
| @@ -212,11 +212,11 @@ | |
| 212 | int rc; |
| 213 | |
| 214 | /* First make sure the SQL is a single query command by verifying that |
| 215 | ** the first token is "SELECT" and that there are no unquoted semicolons. |
| 216 | */ |
| 217 | for(i=0; fossil_isspace(zSql[i]); i++){} |
| 218 | if( strncasecmp(&zSql[i],"select",6)!=0 ){ |
| 219 | return mprintf("The SQL must be a SELECT statement"); |
| 220 | } |
| 221 | for(i=0; zSql[i]; i++){ |
| 222 | if( zSql[i]==';' ){ |
| @@ -743,15 +743,15 @@ | |
| 743 | ** spaces. |
| 744 | */ |
| 745 | static void output_no_tabs(const char *z){ |
| 746 | while( z && z[0] ){ |
| 747 | int i, j; |
| 748 | for(i=0; z[i] && (!fossil_isspace(z[i]) || z[i]==' '); i++){} |
| 749 | if( i>0 ){ |
| 750 | cgi_printf("%.*s", i, z); |
| 751 | } |
| 752 | for(j=i; fossil_isspace(z[j]); j++){} |
| 753 | if( j>i ){ |
| 754 | cgi_printf("%*s", j-i, ""); |
| 755 | } |
| 756 | z += j; |
| 757 | } |
| @@ -787,21 +787,21 @@ | |
| 787 | ** Generate HTML that describes a color key. |
| 788 | */ |
| 789 | void output_color_key(const char *zClrKey, int horiz, char *zTabArgs){ |
| 790 | int i, j, k; |
| 791 | char *zSafeKey, *zToFree; |
| 792 | while( fossil_isspace(*zClrKey) ) zClrKey++; |
| 793 | if( zClrKey[0]==0 ) return; |
| 794 | @ <table %s(zTabArgs)> |
| 795 | if( horiz ){ |
| 796 | @ <tr> |
| 797 | } |
| 798 | zToFree = zSafeKey = mprintf("%h", zClrKey); |
| 799 | while( zSafeKey[0] ){ |
| 800 | while( fossil_isspace(*zSafeKey) ) zSafeKey++; |
| 801 | for(i=0; zSafeKey[i] && !fossil_isspace(zSafeKey[i]); i++){} |
| 802 | for(j=i; fossil_isspace(zSafeKey[j]); j++){} |
| 803 | for(k=j; zSafeKey[k] && zSafeKey[k]!='\n' && zSafeKey[k]!='\r'; k++){} |
| 804 | if( !horiz ){ |
| 805 | cgi_printf("<tr style=\"background-color: %.*s;\"><td>%.*s</td></tr>\n", |
| 806 | i, zSafeKey, k-j, &zSafeKey[j]); |
| 807 | }else{ |
| @@ -977,15 +977,15 @@ | |
| 977 | break; |
| 978 | } |
| 979 | default: |
| 980 | while( z && z[0] ){ |
| 981 | int i, j; |
| 982 | for(i=0; z[i] && (!fossil_isspace(z[i]) || z[i]==' '); i++){} |
| 983 | if( i>0 ){ |
| 984 | printf("%.*s", i, z); |
| 985 | } |
| 986 | for(j=i; fossil_isspace(z[j]); j++){} |
| 987 | if( j>i ){ |
| 988 | printf("%*s", j-i, ""); |
| 989 | } |
| 990 | z += j; |
| 991 | } |
| 992 |
+2
-2
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -48,14 +48,14 @@ | ||
| 48 | 48 | if( p==0 ) fossil_panic("out of memory"); |
| 49 | 49 | z = (char*)&p[1]; |
| 50 | 50 | strcpy(z, zPattern); |
| 51 | 51 | memset(p, 0, sizeof(*p)); |
| 52 | 52 | while( *z && p->nTerm<sizeof(p->a)/sizeof(p->a[0]) ){ |
| 53 | - while( !isalnum(*z) && *z ){ z++; } | |
| 53 | + while( !fossil_isalnum(*z) && *z ){ z++; } | |
| 54 | 54 | if( *z==0 ) break; |
| 55 | 55 | p->a[p->nTerm].z = z; |
| 56 | - for(i=1; isalnum(z[i]) || z[i]=='_'; i++){} | |
| 56 | + for(i=1; fossil_isalnum(z[i]) || z[i]=='_'; i++){} | |
| 57 | 57 | p->a[p->nTerm].n = i; |
| 58 | 58 | z += i; |
| 59 | 59 | p->nTerm++; |
| 60 | 60 | } |
| 61 | 61 | return p; |
| 62 | 62 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -48,14 +48,14 @@ | |
| 48 | if( p==0 ) fossil_panic("out of memory"); |
| 49 | z = (char*)&p[1]; |
| 50 | strcpy(z, zPattern); |
| 51 | memset(p, 0, sizeof(*p)); |
| 52 | while( *z && p->nTerm<sizeof(p->a)/sizeof(p->a[0]) ){ |
| 53 | while( !isalnum(*z) && *z ){ z++; } |
| 54 | if( *z==0 ) break; |
| 55 | p->a[p->nTerm].z = z; |
| 56 | for(i=1; isalnum(z[i]) || z[i]=='_'; i++){} |
| 57 | p->a[p->nTerm].n = i; |
| 58 | z += i; |
| 59 | p->nTerm++; |
| 60 | } |
| 61 | return p; |
| 62 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -48,14 +48,14 @@ | |
| 48 | if( p==0 ) fossil_panic("out of memory"); |
| 49 | z = (char*)&p[1]; |
| 50 | strcpy(z, zPattern); |
| 51 | memset(p, 0, sizeof(*p)); |
| 52 | while( *z && p->nTerm<sizeof(p->a)/sizeof(p->a[0]) ){ |
| 53 | while( !fossil_isalnum(*z) && *z ){ z++; } |
| 54 | if( *z==0 ) break; |
| 55 | p->a[p->nTerm].z = z; |
| 56 | for(i=1; fossil_isalnum(z[i]) || z[i]=='_'; i++){} |
| 57 | p->a[p->nTerm].n = i; |
| 58 | z += i; |
| 59 | p->nTerm++; |
| 60 | } |
| 61 | return p; |
| 62 |
+3
-3
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -435,20 +435,20 @@ | ||
| 435 | 435 | int inBracket = 0; |
| 436 | 436 | if( z[0]=='<' ){ |
| 437 | 437 | inBracket = 1; |
| 438 | 438 | z++; |
| 439 | 439 | } |
| 440 | - if( z[0]==':' && z[1]==':' && isalpha(z[2]) ){ | |
| 440 | + if( z[0]==':' && z[1]==':' && fossil_isalpha(z[2]) ){ | |
| 441 | 441 | z += 3; |
| 442 | 442 | i += 3; |
| 443 | - }else if( isalpha(z[0]) ){ | |
| 443 | + }else if( fossil_isalpha(z[0]) ){ | |
| 444 | 444 | z ++; |
| 445 | 445 | i += 1; |
| 446 | 446 | }else{ |
| 447 | 447 | return 0; |
| 448 | 448 | } |
| 449 | - while( isalnum(z[0]) || z[0]=='_' ){ | |
| 449 | + while( fossil_isalnum(z[0]) || z[0]=='_' ){ | |
| 450 | 450 | z++; |
| 451 | 451 | i++; |
| 452 | 452 | } |
| 453 | 453 | if( inBracket ){ |
| 454 | 454 | if( z[0]!='>' ) return 0; |
| 455 | 455 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -435,20 +435,20 @@ | |
| 435 | int inBracket = 0; |
| 436 | if( z[0]=='<' ){ |
| 437 | inBracket = 1; |
| 438 | z++; |
| 439 | } |
| 440 | if( z[0]==':' && z[1]==':' && isalpha(z[2]) ){ |
| 441 | z += 3; |
| 442 | i += 3; |
| 443 | }else if( isalpha(z[0]) ){ |
| 444 | z ++; |
| 445 | i += 1; |
| 446 | }else{ |
| 447 | return 0; |
| 448 | } |
| 449 | while( isalnum(z[0]) || z[0]=='_' ){ |
| 450 | z++; |
| 451 | i++; |
| 452 | } |
| 453 | if( inBracket ){ |
| 454 | if( z[0]!='>' ) return 0; |
| 455 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -435,20 +435,20 @@ | |
| 435 | int inBracket = 0; |
| 436 | if( z[0]=='<' ){ |
| 437 | inBracket = 1; |
| 438 | z++; |
| 439 | } |
| 440 | if( z[0]==':' && z[1]==':' && fossil_isalpha(z[2]) ){ |
| 441 | z += 3; |
| 442 | i += 3; |
| 443 | }else if( fossil_isalpha(z[0]) ){ |
| 444 | z ++; |
| 445 | i += 1; |
| 446 | }else{ |
| 447 | return 0; |
| 448 | } |
| 449 | while( fossil_isalnum(z[0]) || z[0]=='_' ){ |
| 450 | z++; |
| 451 | i++; |
| 452 | } |
| 453 | if( inBracket ){ |
| 454 | if( z[0]!='>' ) return 0; |
| 455 |
+5
-5
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -830,11 +830,11 @@ | ||
| 830 | 830 | " AND (event.comment LIKE '%%%q%%' OR event.brief LIKE '%%%q%%')", |
| 831 | 831 | zSearch, zSearch); |
| 832 | 832 | url_add_parameter(&url, "s", zSearch); |
| 833 | 833 | } |
| 834 | 834 | if( zAfter ){ |
| 835 | - while( isspace(zAfter[0]) ){ zAfter++; } | |
| 835 | + while( fossil_isspace(zAfter[0]) ){ zAfter++; } | |
| 836 | 836 | if( zAfter[0] ){ |
| 837 | 837 | blob_appendf(&sql, |
| 838 | 838 | " AND event.mtime>=(SELECT julianday(%Q, 'utc'))" |
| 839 | 839 | " ORDER BY event.mtime ASC", zAfter); |
| 840 | 840 | url_add_parameter(&url, "a", zAfter); |
| @@ -841,21 +841,21 @@ | ||
| 841 | 841 | zBefore = 0; |
| 842 | 842 | }else{ |
| 843 | 843 | zAfter = 0; |
| 844 | 844 | } |
| 845 | 845 | }else if( zBefore ){ |
| 846 | - while( isspace(zBefore[0]) ){ zBefore++; } | |
| 846 | + while( fossil_isspace(zBefore[0]) ){ zBefore++; } | |
| 847 | 847 | if( zBefore[0] ){ |
| 848 | 848 | blob_appendf(&sql, |
| 849 | 849 | " AND event.mtime<=(SELECT julianday(%Q, 'utc'))" |
| 850 | 850 | " ORDER BY event.mtime DESC", zBefore); |
| 851 | 851 | url_add_parameter(&url, "b", zBefore); |
| 852 | 852 | }else{ |
| 853 | 853 | zBefore = 0; |
| 854 | 854 | } |
| 855 | 855 | }else if( zCirca ){ |
| 856 | - while( isspace(zCirca[0]) ){ zCirca++; } | |
| 856 | + while( fossil_isspace(zCirca[0]) ){ zCirca++; } | |
| 857 | 857 | if( zCirca[0] ){ |
| 858 | 858 | double rCirca = db_double(0.0, "SELECT julianday(%Q, 'utc')", zCirca); |
| 859 | 859 | Blob sql2; |
| 860 | 860 | blob_init(&sql2, blob_str(&sql), -1); |
| 861 | 861 | blob_appendf(&sql2, |
| @@ -1060,12 +1060,12 @@ | ||
| 1060 | 1060 | */ |
| 1061 | 1061 | static int isIsoDate(const char *z){ |
| 1062 | 1062 | return strlen(z)==10 |
| 1063 | 1063 | && z[4]=='-' |
| 1064 | 1064 | && z[7]=='-' |
| 1065 | - && isdigit(z[0]) | |
| 1066 | - && isdigit(z[5]); | |
| 1065 | + && fossil_isdigit(z[0]) | |
| 1066 | + && fossil_isdigit(z[5]); | |
| 1067 | 1067 | } |
| 1068 | 1068 | |
| 1069 | 1069 | /* |
| 1070 | 1070 | ** COMMAND: timeline |
| 1071 | 1071 | ** |
| 1072 | 1072 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -830,11 +830,11 @@ | |
| 830 | " AND (event.comment LIKE '%%%q%%' OR event.brief LIKE '%%%q%%')", |
| 831 | zSearch, zSearch); |
| 832 | url_add_parameter(&url, "s", zSearch); |
| 833 | } |
| 834 | if( zAfter ){ |
| 835 | while( isspace(zAfter[0]) ){ zAfter++; } |
| 836 | if( zAfter[0] ){ |
| 837 | blob_appendf(&sql, |
| 838 | " AND event.mtime>=(SELECT julianday(%Q, 'utc'))" |
| 839 | " ORDER BY event.mtime ASC", zAfter); |
| 840 | url_add_parameter(&url, "a", zAfter); |
| @@ -841,21 +841,21 @@ | |
| 841 | zBefore = 0; |
| 842 | }else{ |
| 843 | zAfter = 0; |
| 844 | } |
| 845 | }else if( zBefore ){ |
| 846 | while( isspace(zBefore[0]) ){ zBefore++; } |
| 847 | if( zBefore[0] ){ |
| 848 | blob_appendf(&sql, |
| 849 | " AND event.mtime<=(SELECT julianday(%Q, 'utc'))" |
| 850 | " ORDER BY event.mtime DESC", zBefore); |
| 851 | url_add_parameter(&url, "b", zBefore); |
| 852 | }else{ |
| 853 | zBefore = 0; |
| 854 | } |
| 855 | }else if( zCirca ){ |
| 856 | while( isspace(zCirca[0]) ){ zCirca++; } |
| 857 | if( zCirca[0] ){ |
| 858 | double rCirca = db_double(0.0, "SELECT julianday(%Q, 'utc')", zCirca); |
| 859 | Blob sql2; |
| 860 | blob_init(&sql2, blob_str(&sql), -1); |
| 861 | blob_appendf(&sql2, |
| @@ -1060,12 +1060,12 @@ | |
| 1060 | */ |
| 1061 | static int isIsoDate(const char *z){ |
| 1062 | return strlen(z)==10 |
| 1063 | && z[4]=='-' |
| 1064 | && z[7]=='-' |
| 1065 | && isdigit(z[0]) |
| 1066 | && isdigit(z[5]); |
| 1067 | } |
| 1068 | |
| 1069 | /* |
| 1070 | ** COMMAND: timeline |
| 1071 | ** |
| 1072 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -830,11 +830,11 @@ | |
| 830 | " AND (event.comment LIKE '%%%q%%' OR event.brief LIKE '%%%q%%')", |
| 831 | zSearch, zSearch); |
| 832 | url_add_parameter(&url, "s", zSearch); |
| 833 | } |
| 834 | if( zAfter ){ |
| 835 | while( fossil_isspace(zAfter[0]) ){ zAfter++; } |
| 836 | if( zAfter[0] ){ |
| 837 | blob_appendf(&sql, |
| 838 | " AND event.mtime>=(SELECT julianday(%Q, 'utc'))" |
| 839 | " ORDER BY event.mtime ASC", zAfter); |
| 840 | url_add_parameter(&url, "a", zAfter); |
| @@ -841,21 +841,21 @@ | |
| 841 | zBefore = 0; |
| 842 | }else{ |
| 843 | zAfter = 0; |
| 844 | } |
| 845 | }else if( zBefore ){ |
| 846 | while( fossil_isspace(zBefore[0]) ){ zBefore++; } |
| 847 | if( zBefore[0] ){ |
| 848 | blob_appendf(&sql, |
| 849 | " AND event.mtime<=(SELECT julianday(%Q, 'utc'))" |
| 850 | " ORDER BY event.mtime DESC", zBefore); |
| 851 | url_add_parameter(&url, "b", zBefore); |
| 852 | }else{ |
| 853 | zBefore = 0; |
| 854 | } |
| 855 | }else if( zCirca ){ |
| 856 | while( fossil_isspace(zCirca[0]) ){ zCirca++; } |
| 857 | if( zCirca[0] ){ |
| 858 | double rCirca = db_double(0.0, "SELECT julianday(%Q, 'utc')", zCirca); |
| 859 | Blob sql2; |
| 860 | blob_init(&sql2, blob_str(&sql), -1); |
| 861 | blob_appendf(&sql2, |
| @@ -1060,12 +1060,12 @@ | |
| 1060 | */ |
| 1061 | static int isIsoDate(const char *z){ |
| 1062 | return strlen(z)==10 |
| 1063 | && z[4]=='-' |
| 1064 | && z[7]=='-' |
| 1065 | && fossil_isdigit(z[0]) |
| 1066 | && fossil_isdigit(z[5]); |
| 1067 | } |
| 1068 | |
| 1069 | /* |
| 1070 | ** COMMAND: timeline |
| 1071 | ** |
| 1072 |
+1
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -445,11 +445,11 @@ | ||
| 445 | 445 | blob_appendf(&tktchng, "J +%s %z\n", azField[i], |
| 446 | 446 | fossilize(azAppend[i], -1)); |
| 447 | 447 | }else{ |
| 448 | 448 | zValue = Th_Fetch(azField[i], &nValue); |
| 449 | 449 | if( zValue ){ |
| 450 | - while( nValue>0 && isspace(zValue[nValue-1]) ){ nValue--; } | |
| 450 | + while( nValue>0 && fossil_isspace(zValue[nValue-1]) ){ nValue--; } | |
| 451 | 451 | if( strncmp(zValue, azValue[i], nValue) || strlen(azValue[i])!=nValue ){ |
| 452 | 452 | if( strncmp(azField[i], "private_", 8)==0 ){ |
| 453 | 453 | zValue = db_conceal(zValue, nValue); |
| 454 | 454 | blob_appendf(&tktchng, "J %s %s\n", azField[i], zValue); |
| 455 | 455 | }else{ |
| 456 | 456 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -445,11 +445,11 @@ | |
| 445 | blob_appendf(&tktchng, "J +%s %z\n", azField[i], |
| 446 | fossilize(azAppend[i], -1)); |
| 447 | }else{ |
| 448 | zValue = Th_Fetch(azField[i], &nValue); |
| 449 | if( zValue ){ |
| 450 | while( nValue>0 && isspace(zValue[nValue-1]) ){ nValue--; } |
| 451 | if( strncmp(zValue, azValue[i], nValue) || strlen(azValue[i])!=nValue ){ |
| 452 | if( strncmp(azField[i], "private_", 8)==0 ){ |
| 453 | zValue = db_conceal(zValue, nValue); |
| 454 | blob_appendf(&tktchng, "J %s %s\n", azField[i], zValue); |
| 455 | }else{ |
| 456 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -445,11 +445,11 @@ | |
| 445 | blob_appendf(&tktchng, "J +%s %z\n", azField[i], |
| 446 | fossilize(azAppend[i], -1)); |
| 447 | }else{ |
| 448 | zValue = Th_Fetch(azField[i], &nValue); |
| 449 | if( zValue ){ |
| 450 | while( nValue>0 && fossil_isspace(zValue[nValue-1]) ){ nValue--; } |
| 451 | if( strncmp(zValue, azValue[i], nValue) || strlen(azValue[i])!=nValue ){ |
| 452 | if( strncmp(azField[i], "private_", 8)==0 ){ |
| 453 | zValue = db_conceal(zValue, nValue); |
| 454 | blob_appendf(&tktchng, "J %s %s\n", azField[i], zValue); |
| 455 | }else{ |
| 456 |
+2
-2
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -23,11 +23,11 @@ | ||
| 23 | 23 | /* |
| 24 | 24 | ** Convert a string to lower-case. |
| 25 | 25 | */ |
| 26 | 26 | static void url_tolower(char *z){ |
| 27 | 27 | while( *z ){ |
| 28 | - *z = tolower(*z); | |
| 28 | + *z = fossil_tolower(*z); | |
| 29 | 29 | z++; |
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /* |
| @@ -109,11 +109,11 @@ | ||
| 109 | 109 | } |
| 110 | 110 | url_tolower(g.urlName); |
| 111 | 111 | if( c==':' ){ |
| 112 | 112 | g.urlPort = 0; |
| 113 | 113 | i++; |
| 114 | - while( (c = zUrl[i])!=0 && isdigit(c) ){ | |
| 114 | + while( (c = zUrl[i])!=0 && fossil_isdigit(c) ){ | |
| 115 | 115 | g.urlPort = g.urlPort*10 + c - '0'; |
| 116 | 116 | i++; |
| 117 | 117 | } |
| 118 | 118 | g.urlHostname = mprintf("%s:%d", g.urlName, g.urlPort); |
| 119 | 119 | }else{ |
| 120 | 120 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -23,11 +23,11 @@ | |
| 23 | /* |
| 24 | ** Convert a string to lower-case. |
| 25 | */ |
| 26 | static void url_tolower(char *z){ |
| 27 | while( *z ){ |
| 28 | *z = tolower(*z); |
| 29 | z++; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | /* |
| @@ -109,11 +109,11 @@ | |
| 109 | } |
| 110 | url_tolower(g.urlName); |
| 111 | if( c==':' ){ |
| 112 | g.urlPort = 0; |
| 113 | i++; |
| 114 | while( (c = zUrl[i])!=0 && isdigit(c) ){ |
| 115 | g.urlPort = g.urlPort*10 + c - '0'; |
| 116 | i++; |
| 117 | } |
| 118 | g.urlHostname = mprintf("%s:%d", g.urlName, g.urlPort); |
| 119 | }else{ |
| 120 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -23,11 +23,11 @@ | |
| 23 | /* |
| 24 | ** Convert a string to lower-case. |
| 25 | */ |
| 26 | static void url_tolower(char *z){ |
| 27 | while( *z ){ |
| 28 | *z = fossil_tolower(*z); |
| 29 | z++; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | /* |
| @@ -109,11 +109,11 @@ | |
| 109 | } |
| 110 | url_tolower(g.urlName); |
| 111 | if( c==':' ){ |
| 112 | g.urlPort = 0; |
| 113 | i++; |
| 114 | while( (c = zUrl[i])!=0 && fossil_isdigit(c) ){ |
| 115 | g.urlPort = g.urlPort*10 + c - '0'; |
| 116 | i++; |
| 117 | } |
| 118 | g.urlHostname = mprintf("%s:%d", g.urlName, g.urlPort); |
| 119 | }else{ |
| 120 |
+2
-2
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -27,14 +27,14 @@ | ||
| 27 | 27 | ** onto the end of a blob. |
| 28 | 28 | */ |
| 29 | 29 | static void strip_string(Blob *pBlob, char *z){ |
| 30 | 30 | int i; |
| 31 | 31 | blob_reset(pBlob); |
| 32 | - while( isspace(*z) ){ z++; } | |
| 32 | + while( fossil_isspace(*z) ){ z++; } | |
| 33 | 33 | for(i=0; z[i]; i++){ |
| 34 | 34 | if( z[i]=='\r' || z[i]=='\n' ){ |
| 35 | - while( i>0 && isspace(z[i-1]) ){ i--; } | |
| 35 | + while( i>0 && fossil_isspace(z[i-1]) ){ i--; } | |
| 36 | 36 | z[i] = 0; |
| 37 | 37 | break; |
| 38 | 38 | } |
| 39 | 39 | if( z[i]<' ' ) z[i] = ' '; |
| 40 | 40 | } |
| 41 | 41 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -27,14 +27,14 @@ | |
| 27 | ** onto the end of a blob. |
| 28 | */ |
| 29 | static void strip_string(Blob *pBlob, char *z){ |
| 30 | int i; |
| 31 | blob_reset(pBlob); |
| 32 | while( isspace(*z) ){ z++; } |
| 33 | for(i=0; z[i]; i++){ |
| 34 | if( z[i]=='\r' || z[i]=='\n' ){ |
| 35 | while( i>0 && isspace(z[i-1]) ){ i--; } |
| 36 | z[i] = 0; |
| 37 | break; |
| 38 | } |
| 39 | if( z[i]<' ' ) z[i] = ' '; |
| 40 | } |
| 41 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -27,14 +27,14 @@ | |
| 27 | ** onto the end of a blob. |
| 28 | */ |
| 29 | static void strip_string(Blob *pBlob, char *z){ |
| 30 | int i; |
| 31 | blob_reset(pBlob); |
| 32 | while( fossil_isspace(*z) ){ z++; } |
| 33 | for(i=0; z[i]; i++){ |
| 34 | if( z[i]=='\r' || z[i]=='\n' ){ |
| 35 | while( i>0 && fossil_isspace(z[i-1]) ){ i--; } |
| 36 | z[i] = 0; |
| 37 | break; |
| 38 | } |
| 39 | if( z[i]<' ' ) z[i] = ' '; |
| 40 | } |
| 41 |
+2
-2
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -186,11 +186,11 @@ | ||
| 186 | 186 | if( rid ){ |
| 187 | 187 | Blob content; |
| 188 | 188 | content_get(rid, &content); |
| 189 | 189 | manifest_parse(&m, &content); |
| 190 | 190 | if( m.type==CFTYPE_WIKI && m.zWiki ){ |
| 191 | - while( isspace(m.zWiki[0]) ) m.zWiki++; | |
| 191 | + while( fossil_isspace(m.zWiki[0]) ) m.zWiki++; | |
| 192 | 192 | if( m.zWiki[0] ) zBody = m.zWiki; |
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | } |
| 196 | 196 | if( !g.isHome ){ |
| @@ -938,11 +938,11 @@ | ||
| 938 | 938 | } |
| 939 | 939 | } |
| 940 | 940 | if( zBody==0 ){ |
| 941 | 941 | fossil_fatal("wiki page [%s] not found",zPageName); |
| 942 | 942 | } |
| 943 | - for(i=strlen(zBody); i>0 && isspace(zBody[i-1]); i--){} | |
| 943 | + for(i=strlen(zBody); i>0 && fossil_isspace(zBody[i-1]); i--){} | |
| 944 | 944 | zFile = (g.argc==4) ? 0 : g.argv[4]; |
| 945 | 945 | if( zFile ){ |
| 946 | 946 | FILE * zF; |
| 947 | 947 | short doClose = 0; |
| 948 | 948 | if( (1 == strlen(zFile)) && ('-'==zFile[0]) ){ |
| 949 | 949 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -186,11 +186,11 @@ | |
| 186 | if( rid ){ |
| 187 | Blob content; |
| 188 | content_get(rid, &content); |
| 189 | manifest_parse(&m, &content); |
| 190 | if( m.type==CFTYPE_WIKI && m.zWiki ){ |
| 191 | while( isspace(m.zWiki[0]) ) m.zWiki++; |
| 192 | if( m.zWiki[0] ) zBody = m.zWiki; |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | if( !g.isHome ){ |
| @@ -938,11 +938,11 @@ | |
| 938 | } |
| 939 | } |
| 940 | if( zBody==0 ){ |
| 941 | fossil_fatal("wiki page [%s] not found",zPageName); |
| 942 | } |
| 943 | for(i=strlen(zBody); i>0 && isspace(zBody[i-1]); i--){} |
| 944 | zFile = (g.argc==4) ? 0 : g.argv[4]; |
| 945 | if( zFile ){ |
| 946 | FILE * zF; |
| 947 | short doClose = 0; |
| 948 | if( (1 == strlen(zFile)) && ('-'==zFile[0]) ){ |
| 949 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -186,11 +186,11 @@ | |
| 186 | if( rid ){ |
| 187 | Blob content; |
| 188 | content_get(rid, &content); |
| 189 | manifest_parse(&m, &content); |
| 190 | if( m.type==CFTYPE_WIKI && m.zWiki ){ |
| 191 | while( fossil_isspace(m.zWiki[0]) ) m.zWiki++; |
| 192 | if( m.zWiki[0] ) zBody = m.zWiki; |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | if( !g.isHome ){ |
| @@ -938,11 +938,11 @@ | |
| 938 | } |
| 939 | } |
| 940 | if( zBody==0 ){ |
| 941 | fossil_fatal("wiki page [%s] not found",zPageName); |
| 942 | } |
| 943 | for(i=strlen(zBody); i>0 && fossil_isspace(zBody[i-1]); i--){} |
| 944 | zFile = (g.argc==4) ? 0 : g.argv[4]; |
| 945 | if( zFile ){ |
| 946 | FILE * zF; |
| 947 | short doClose = 0; |
| 948 | if( (1 == strlen(zFile)) && ('-'==zFile[0]) ){ |
| 949 |
+28
-28
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -412,15 +412,15 @@ | ||
| 412 | 412 | static int markupLength(const char *z){ |
| 413 | 413 | int n = 1; |
| 414 | 414 | int inparen = 0; |
| 415 | 415 | int c; |
| 416 | 416 | if( z[n]=='/' ){ n++; } |
| 417 | - if( !isalpha(z[n]) ) return 0; | |
| 418 | - while( isalnum(z[n]) ){ n++; } | |
| 417 | + if( !fossil_isalpha(z[n]) ) return 0; | |
| 418 | + while( fossil_isalnum(z[n]) ){ n++; } | |
| 419 | 419 | c = z[n]; |
| 420 | 420 | if( c=='/' && z[n+1]=='>' ){ return n+2; } |
| 421 | - if( c!='>' && !isspace(c) ) return 0; | |
| 421 | + if( c!='>' && !fossil_isspace(c) ) return 0; | |
| 422 | 422 | while( (c = z[n])!=0 && (c!='>' || inparen) ){ |
| 423 | 423 | if( c==inparen ){ |
| 424 | 424 | inparen = 0; |
| 425 | 425 | }else if( inparen==0 && (c=='"' || c=='\'') ){ |
| 426 | 426 | inparen = c; |
| @@ -437,11 +437,11 @@ | ||
| 437 | 437 | ** of characters through the closing "\n". If not, return 0. |
| 438 | 438 | */ |
| 439 | 439 | static int paragraphBreakLength(const char *z){ |
| 440 | 440 | int i, n; |
| 441 | 441 | int nNewline = 1; |
| 442 | - for(i=1, n=0; isspace(z[i]); i++){ | |
| 442 | + for(i=1, n=0; fossil_isspace(z[i]); i++){ | |
| 443 | 443 | if( z[i]=='\n' ){ |
| 444 | 444 | nNewline++; |
| 445 | 445 | n = i; |
| 446 | 446 | } |
| 447 | 447 | } |
| @@ -482,14 +482,14 @@ | ||
| 482 | 482 | */ |
| 483 | 483 | static int isElement(const char *z){ |
| 484 | 484 | int i; |
| 485 | 485 | assert( z[0]=='&' ); |
| 486 | 486 | if( z[1]=='#' ){ |
| 487 | - for(i=2; isdigit(z[i]); i++){} | |
| 487 | + for(i=2; fossil_isdigit(z[i]); i++){} | |
| 488 | 488 | return i>2 && z[i]==';'; |
| 489 | 489 | }else{ |
| 490 | - for(i=1; isalpha(z[i]); i++){} | |
| 490 | + for(i=1; fossil_isalpha(z[i]); i++){} | |
| 491 | 491 | return i>1 && z[i]==';'; |
| 492 | 492 | } |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | /* |
| @@ -511,11 +511,11 @@ | ||
| 511 | 511 | while( z[n]==' ' || z[n]=='\t' ){ |
| 512 | 512 | if( z[n]=='\t' ) i++; |
| 513 | 513 | i++; |
| 514 | 514 | n++; |
| 515 | 515 | } |
| 516 | - if( i<2 || isspace(z[n]) ) return 0; | |
| 516 | + if( i<2 || fossil_isspace(z[n]) ) return 0; | |
| 517 | 517 | return n; |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | /* |
| 521 | 521 | ** Check to see if the z[] string is the beginning of a enumeration value. |
| @@ -536,11 +536,11 @@ | ||
| 536 | 536 | if( z[n]=='\t' ) i++; |
| 537 | 537 | i++; |
| 538 | 538 | n++; |
| 539 | 539 | } |
| 540 | 540 | if( i<2 ) return 0; |
| 541 | - for(i=0; isdigit(z[n]); i++, n++){} | |
| 541 | + for(i=0; fossil_isdigit(z[n]); i++, n++){} | |
| 542 | 542 | if( i==0 ) return 0; |
| 543 | 543 | if( z[n]=='.' ){ |
| 544 | 544 | n++; |
| 545 | 545 | } |
| 546 | 546 | i = 0; |
| @@ -547,11 +547,11 @@ | ||
| 547 | 547 | while( z[n]==' ' || z[n]=='\t' ){ |
| 548 | 548 | if( z[n]=='\t' ) i++; |
| 549 | 549 | i++; |
| 550 | 550 | n++; |
| 551 | 551 | } |
| 552 | - if( i<2 || isspace(z[n]) ) return 0; | |
| 552 | + if( i<2 || fossil_isspace(z[n]) ) return 0; | |
| 553 | 553 | return n; |
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | /* |
| 557 | 557 | ** Check to see if the z[] string is the beginning of an indented |
| @@ -565,11 +565,11 @@ | ||
| 565 | 565 | while( z[n]==' ' || z[n]=='\t' ){ |
| 566 | 566 | if( z[n]=='\t' ) i++; |
| 567 | 567 | i++; |
| 568 | 568 | n++; |
| 569 | 569 | } |
| 570 | - if( i<2 || isspace(z[n]) ) return 0; | |
| 570 | + if( i<2 || fossil_isspace(z[n]) ) return 0; | |
| 571 | 571 | return n; |
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | /* |
| 575 | 575 | ** Check to see if the z[] string is a wiki hyperlink. If it is, |
| @@ -612,16 +612,16 @@ | ||
| 612 | 612 | if( z[0]=='\n' ){ |
| 613 | 613 | n = paragraphBreakLength(z); |
| 614 | 614 | if( n>0 ){ |
| 615 | 615 | *pTokenType = TOKEN_PARAGRAPH; |
| 616 | 616 | return n; |
| 617 | - }else if( isspace(z[1]) ){ | |
| 617 | + }else if( fossil_isspace(z[1]) ){ | |
| 618 | 618 | *pTokenType = TOKEN_NEWLINE; |
| 619 | 619 | return 1; |
| 620 | 620 | } |
| 621 | 621 | } |
| 622 | - if( (p->state & AT_NEWLINE)!=0 && isspace(z[0]) ){ | |
| 622 | + if( (p->state & AT_NEWLINE)!=0 && fossil_isspace(z[0]) ){ | |
| 623 | 623 | n = listItemLength(z, '*'); |
| 624 | 624 | if( n>0 ){ |
| 625 | 625 | *pTokenType = TOKEN_BUL_LI; |
| 626 | 626 | return n; |
| 627 | 627 | } |
| @@ -634,11 +634,11 @@ | ||
| 634 | 634 | if( n>0 ){ |
| 635 | 635 | *pTokenType = TOKEN_ENUM; |
| 636 | 636 | return n; |
| 637 | 637 | } |
| 638 | 638 | } |
| 639 | - if( (p->state & AT_PARAGRAPH)!=0 && isspace(z[0]) ){ | |
| 639 | + if( (p->state & AT_PARAGRAPH)!=0 && fossil_isspace(z[0]) ){ | |
| 640 | 640 | n = indentLength(z); |
| 641 | 641 | if( n>0 ){ |
| 642 | 642 | *pTokenType = TOKEN_INDENT; |
| 643 | 643 | return n; |
| 644 | 644 | } |
| @@ -705,37 +705,37 @@ | ||
| 705 | 705 | }else{ |
| 706 | 706 | p->endTag = 0; |
| 707 | 707 | i = 1; |
| 708 | 708 | } |
| 709 | 709 | j = 0; |
| 710 | - while( isalnum(z[i]) ){ | |
| 711 | - if( j<sizeof(zTag)-1 ) zTag[j++] = tolower(z[i]); | |
| 710 | + while( fossil_isalnum(z[i]) ){ | |
| 711 | + if( j<sizeof(zTag)-1 ) zTag[j++] = fossil_tolower(z[i]); | |
| 712 | 712 | i++; |
| 713 | 713 | } |
| 714 | 714 | zTag[j] = 0; |
| 715 | 715 | p->iCode = findTag(zTag); |
| 716 | 716 | p->iType = aMarkup[p->iCode].iType; |
| 717 | 717 | p->nAttr = 0; |
| 718 | - while( isspace(z[i]) ){ i++; } | |
| 719 | - while( p->nAttr<8 && isalpha(z[i]) ){ | |
| 718 | + while( fossil_isspace(z[i]) ){ i++; } | |
| 719 | + while( p->nAttr<8 && fossil_isalpha(z[i]) ){ | |
| 720 | 720 | int attrOk; /* True to preserver attribute. False to ignore it */ |
| 721 | 721 | j = 0; |
| 722 | - while( isalnum(z[i]) ){ | |
| 723 | - if( j<sizeof(zTag)-1 ) zTag[j++] = tolower(z[i]); | |
| 722 | + while( fossil_isalnum(z[i]) ){ | |
| 723 | + if( j<sizeof(zTag)-1 ) zTag[j++] = fossil_tolower(z[i]); | |
| 724 | 724 | i++; |
| 725 | 725 | } |
| 726 | 726 | zTag[j] = 0; |
| 727 | 727 | p->aAttr[p->nAttr].iACode = iACode = findAttr(zTag); |
| 728 | 728 | attrOk = iACode!=0 && (seen & aAttribute[iACode].iMask)==0; |
| 729 | - while( isspace(z[i]) ){ z++; } | |
| 729 | + while( fossil_isspace(z[i]) ){ z++; } | |
| 730 | 730 | if( z[i]!='=' ){ |
| 731 | 731 | p->aAttr[p->nAttr].zValue = 0; |
| 732 | 732 | p->aAttr[p->nAttr].cTerm = 0; |
| 733 | 733 | c = 0; |
| 734 | 734 | }else{ |
| 735 | 735 | i++; |
| 736 | - while( isspace(z[i]) ){ z++; } | |
| 736 | + while( fossil_isspace(z[i]) ){ z++; } | |
| 737 | 737 | if( z[i]=='"' ){ |
| 738 | 738 | i++; |
| 739 | 739 | zValue = &z[i]; |
| 740 | 740 | while( z[i] && z[i]!='"' ){ i++; } |
| 741 | 741 | }else if( z[i]=='\'' ){ |
| @@ -742,11 +742,11 @@ | ||
| 742 | 742 | i++; |
| 743 | 743 | zValue = &z[i]; |
| 744 | 744 | while( z[i] && z[i]!='\'' ){ i++; } |
| 745 | 745 | }else{ |
| 746 | 746 | zValue = &z[i]; |
| 747 | - while( !isspace(z[i]) && z[i]!='>' ){ z++; } | |
| 747 | + while( !fossil_isspace(z[i]) && z[i]!='>' ){ z++; } | |
| 748 | 748 | } |
| 749 | 749 | if( attrOk ){ |
| 750 | 750 | p->aAttr[p->nAttr].zValue = zValue; |
| 751 | 751 | p->aAttr[p->nAttr].cTerm = c = z[i]; |
| 752 | 752 | z[i] = 0; |
| @@ -755,11 +755,11 @@ | ||
| 755 | 755 | } |
| 756 | 756 | if( attrOk ){ |
| 757 | 757 | seen |= aAttribute[iACode].iMask; |
| 758 | 758 | p->nAttr++; |
| 759 | 759 | } |
| 760 | - while( isspace(z[i]) ){ i++; } | |
| 760 | + while( fossil_isspace(z[i]) ){ i++; } | |
| 761 | 761 | if( z[i]=='>' || (z[i]=='/' && z[i+1]=='>') ) break; |
| 762 | 762 | } |
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | /* |
| @@ -1067,11 +1067,11 @@ | ||
| 1067 | 1067 | } |
| 1068 | 1068 | } |
| 1069 | 1069 | }else if( g.okHistory ){ |
| 1070 | 1070 | blob_appendf(p->pOut, "<a href=\"%s/info/%s\">", g.zBaseURL, zTarget); |
| 1071 | 1071 | } |
| 1072 | - }else if( strlen(zTarget)>=10 && isdigit(zTarget[0]) && zTarget[4]=='-' | |
| 1072 | + }else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-' | |
| 1073 | 1073 | && db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){ |
| 1074 | 1074 | blob_appendf(p->pOut, "<a href=\"%s/timeline?c=%T\">", g.zBaseURL, zTarget); |
| 1075 | 1075 | }else if( strncmp(zTarget, "wiki:", 5)==0 |
| 1076 | 1076 | && wiki_name_is_wellformed((const unsigned char*)zTarget) ){ |
| 1077 | 1077 | zTarget += 5; |
| @@ -1245,18 +1245,18 @@ | ||
| 1245 | 1245 | zTarget = &z[1]; |
| 1246 | 1246 | for(i=1; z[i] && z[i]!=']'; i++){ |
| 1247 | 1247 | if( z[i]=='|' && zDisplay==0 ){ |
| 1248 | 1248 | zDisplay = &z[i+1]; |
| 1249 | 1249 | z[i] = 0; |
| 1250 | - for(j=i-1; j>0 && isspace(z[j]); j--){ z[j] = 0; } | |
| 1250 | + for(j=i-1; j>0 && fossil_isspace(z[j]); j--){ z[j] = 0; } | |
| 1251 | 1251 | } |
| 1252 | 1252 | } |
| 1253 | 1253 | z[i] = 0; |
| 1254 | 1254 | if( zDisplay==0 ){ |
| 1255 | 1255 | zDisplay = zTarget; |
| 1256 | 1256 | }else{ |
| 1257 | - while( isspace(*zDisplay) ) zDisplay++; | |
| 1257 | + while( fossil_isspace(*zDisplay) ) zDisplay++; | |
| 1258 | 1258 | } |
| 1259 | 1259 | openHyperlink(p, zTarget, zClose, sizeof(zClose)); |
| 1260 | 1260 | savedState = p->state; |
| 1261 | 1261 | p->state &= ~ALLOW_WIKI; |
| 1262 | 1262 | p->state |= FONT_MARKUP_ONLY; |
| @@ -1265,11 +1265,11 @@ | ||
| 1265 | 1265 | blob_append(p->pOut, zClose, -1); |
| 1266 | 1266 | break; |
| 1267 | 1267 | } |
| 1268 | 1268 | case TOKEN_TEXT: { |
| 1269 | 1269 | int i; |
| 1270 | - for(i=0; i<n && isspace(z[i]); i++){} | |
| 1270 | + for(i=0; i<n && fossil_isspace(z[i]); i++){} | |
| 1271 | 1271 | if( i<n ) startAutoParagraph(p); |
| 1272 | 1272 | blob_append(p->pOut, z, n); |
| 1273 | 1273 | break; |
| 1274 | 1274 | } |
| 1275 | 1275 | case TOKEN_RAW: { |
| @@ -1521,11 +1521,11 @@ | ||
| 1521 | 1521 | int wiki_find_title(Blob *pIn, Blob *pTitle, Blob *pTail){ |
| 1522 | 1522 | char *z; |
| 1523 | 1523 | int i; |
| 1524 | 1524 | int iStart; |
| 1525 | 1525 | z = skip_bom(blob_str(pIn)); |
| 1526 | - for(i=0; isspace(z[i]); i++){} | |
| 1526 | + for(i=0; fossil_isspace(z[i]); i++){} | |
| 1527 | 1527 | if( z[i]!='<' ) return 0; |
| 1528 | 1528 | i++; |
| 1529 | 1529 | if( strncmp(&z[i],"title>", 6)!=0 ) return 0; |
| 1530 | 1530 | iStart = i+6; |
| 1531 | 1531 | for(i=iStart; z[i] && (z[i]!='<' || strncmp(&z[i],"</title>",8)!=0); i++){} |
| 1532 | 1532 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -412,15 +412,15 @@ | |
| 412 | static int markupLength(const char *z){ |
| 413 | int n = 1; |
| 414 | int inparen = 0; |
| 415 | int c; |
| 416 | if( z[n]=='/' ){ n++; } |
| 417 | if( !isalpha(z[n]) ) return 0; |
| 418 | while( isalnum(z[n]) ){ n++; } |
| 419 | c = z[n]; |
| 420 | if( c=='/' && z[n+1]=='>' ){ return n+2; } |
| 421 | if( c!='>' && !isspace(c) ) return 0; |
| 422 | while( (c = z[n])!=0 && (c!='>' || inparen) ){ |
| 423 | if( c==inparen ){ |
| 424 | inparen = 0; |
| 425 | }else if( inparen==0 && (c=='"' || c=='\'') ){ |
| 426 | inparen = c; |
| @@ -437,11 +437,11 @@ | |
| 437 | ** of characters through the closing "\n". If not, return 0. |
| 438 | */ |
| 439 | static int paragraphBreakLength(const char *z){ |
| 440 | int i, n; |
| 441 | int nNewline = 1; |
| 442 | for(i=1, n=0; isspace(z[i]); i++){ |
| 443 | if( z[i]=='\n' ){ |
| 444 | nNewline++; |
| 445 | n = i; |
| 446 | } |
| 447 | } |
| @@ -482,14 +482,14 @@ | |
| 482 | */ |
| 483 | static int isElement(const char *z){ |
| 484 | int i; |
| 485 | assert( z[0]=='&' ); |
| 486 | if( z[1]=='#' ){ |
| 487 | for(i=2; isdigit(z[i]); i++){} |
| 488 | return i>2 && z[i]==';'; |
| 489 | }else{ |
| 490 | for(i=1; isalpha(z[i]); i++){} |
| 491 | return i>1 && z[i]==';'; |
| 492 | } |
| 493 | } |
| 494 | |
| 495 | /* |
| @@ -511,11 +511,11 @@ | |
| 511 | while( z[n]==' ' || z[n]=='\t' ){ |
| 512 | if( z[n]=='\t' ) i++; |
| 513 | i++; |
| 514 | n++; |
| 515 | } |
| 516 | if( i<2 || isspace(z[n]) ) return 0; |
| 517 | return n; |
| 518 | } |
| 519 | |
| 520 | /* |
| 521 | ** Check to see if the z[] string is the beginning of a enumeration value. |
| @@ -536,11 +536,11 @@ | |
| 536 | if( z[n]=='\t' ) i++; |
| 537 | i++; |
| 538 | n++; |
| 539 | } |
| 540 | if( i<2 ) return 0; |
| 541 | for(i=0; isdigit(z[n]); i++, n++){} |
| 542 | if( i==0 ) return 0; |
| 543 | if( z[n]=='.' ){ |
| 544 | n++; |
| 545 | } |
| 546 | i = 0; |
| @@ -547,11 +547,11 @@ | |
| 547 | while( z[n]==' ' || z[n]=='\t' ){ |
| 548 | if( z[n]=='\t' ) i++; |
| 549 | i++; |
| 550 | n++; |
| 551 | } |
| 552 | if( i<2 || isspace(z[n]) ) return 0; |
| 553 | return n; |
| 554 | } |
| 555 | |
| 556 | /* |
| 557 | ** Check to see if the z[] string is the beginning of an indented |
| @@ -565,11 +565,11 @@ | |
| 565 | while( z[n]==' ' || z[n]=='\t' ){ |
| 566 | if( z[n]=='\t' ) i++; |
| 567 | i++; |
| 568 | n++; |
| 569 | } |
| 570 | if( i<2 || isspace(z[n]) ) return 0; |
| 571 | return n; |
| 572 | } |
| 573 | |
| 574 | /* |
| 575 | ** Check to see if the z[] string is a wiki hyperlink. If it is, |
| @@ -612,16 +612,16 @@ | |
| 612 | if( z[0]=='\n' ){ |
| 613 | n = paragraphBreakLength(z); |
| 614 | if( n>0 ){ |
| 615 | *pTokenType = TOKEN_PARAGRAPH; |
| 616 | return n; |
| 617 | }else if( isspace(z[1]) ){ |
| 618 | *pTokenType = TOKEN_NEWLINE; |
| 619 | return 1; |
| 620 | } |
| 621 | } |
| 622 | if( (p->state & AT_NEWLINE)!=0 && isspace(z[0]) ){ |
| 623 | n = listItemLength(z, '*'); |
| 624 | if( n>0 ){ |
| 625 | *pTokenType = TOKEN_BUL_LI; |
| 626 | return n; |
| 627 | } |
| @@ -634,11 +634,11 @@ | |
| 634 | if( n>0 ){ |
| 635 | *pTokenType = TOKEN_ENUM; |
| 636 | return n; |
| 637 | } |
| 638 | } |
| 639 | if( (p->state & AT_PARAGRAPH)!=0 && isspace(z[0]) ){ |
| 640 | n = indentLength(z); |
| 641 | if( n>0 ){ |
| 642 | *pTokenType = TOKEN_INDENT; |
| 643 | return n; |
| 644 | } |
| @@ -705,37 +705,37 @@ | |
| 705 | }else{ |
| 706 | p->endTag = 0; |
| 707 | i = 1; |
| 708 | } |
| 709 | j = 0; |
| 710 | while( isalnum(z[i]) ){ |
| 711 | if( j<sizeof(zTag)-1 ) zTag[j++] = tolower(z[i]); |
| 712 | i++; |
| 713 | } |
| 714 | zTag[j] = 0; |
| 715 | p->iCode = findTag(zTag); |
| 716 | p->iType = aMarkup[p->iCode].iType; |
| 717 | p->nAttr = 0; |
| 718 | while( isspace(z[i]) ){ i++; } |
| 719 | while( p->nAttr<8 && isalpha(z[i]) ){ |
| 720 | int attrOk; /* True to preserver attribute. False to ignore it */ |
| 721 | j = 0; |
| 722 | while( isalnum(z[i]) ){ |
| 723 | if( j<sizeof(zTag)-1 ) zTag[j++] = tolower(z[i]); |
| 724 | i++; |
| 725 | } |
| 726 | zTag[j] = 0; |
| 727 | p->aAttr[p->nAttr].iACode = iACode = findAttr(zTag); |
| 728 | attrOk = iACode!=0 && (seen & aAttribute[iACode].iMask)==0; |
| 729 | while( isspace(z[i]) ){ z++; } |
| 730 | if( z[i]!='=' ){ |
| 731 | p->aAttr[p->nAttr].zValue = 0; |
| 732 | p->aAttr[p->nAttr].cTerm = 0; |
| 733 | c = 0; |
| 734 | }else{ |
| 735 | i++; |
| 736 | while( isspace(z[i]) ){ z++; } |
| 737 | if( z[i]=='"' ){ |
| 738 | i++; |
| 739 | zValue = &z[i]; |
| 740 | while( z[i] && z[i]!='"' ){ i++; } |
| 741 | }else if( z[i]=='\'' ){ |
| @@ -742,11 +742,11 @@ | |
| 742 | i++; |
| 743 | zValue = &z[i]; |
| 744 | while( z[i] && z[i]!='\'' ){ i++; } |
| 745 | }else{ |
| 746 | zValue = &z[i]; |
| 747 | while( !isspace(z[i]) && z[i]!='>' ){ z++; } |
| 748 | } |
| 749 | if( attrOk ){ |
| 750 | p->aAttr[p->nAttr].zValue = zValue; |
| 751 | p->aAttr[p->nAttr].cTerm = c = z[i]; |
| 752 | z[i] = 0; |
| @@ -755,11 +755,11 @@ | |
| 755 | } |
| 756 | if( attrOk ){ |
| 757 | seen |= aAttribute[iACode].iMask; |
| 758 | p->nAttr++; |
| 759 | } |
| 760 | while( isspace(z[i]) ){ i++; } |
| 761 | if( z[i]=='>' || (z[i]=='/' && z[i+1]=='>') ) break; |
| 762 | } |
| 763 | } |
| 764 | |
| 765 | /* |
| @@ -1067,11 +1067,11 @@ | |
| 1067 | } |
| 1068 | } |
| 1069 | }else if( g.okHistory ){ |
| 1070 | blob_appendf(p->pOut, "<a href=\"%s/info/%s\">", g.zBaseURL, zTarget); |
| 1071 | } |
| 1072 | }else if( strlen(zTarget)>=10 && isdigit(zTarget[0]) && zTarget[4]=='-' |
| 1073 | && db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){ |
| 1074 | blob_appendf(p->pOut, "<a href=\"%s/timeline?c=%T\">", g.zBaseURL, zTarget); |
| 1075 | }else if( strncmp(zTarget, "wiki:", 5)==0 |
| 1076 | && wiki_name_is_wellformed((const unsigned char*)zTarget) ){ |
| 1077 | zTarget += 5; |
| @@ -1245,18 +1245,18 @@ | |
| 1245 | zTarget = &z[1]; |
| 1246 | for(i=1; z[i] && z[i]!=']'; i++){ |
| 1247 | if( z[i]=='|' && zDisplay==0 ){ |
| 1248 | zDisplay = &z[i+1]; |
| 1249 | z[i] = 0; |
| 1250 | for(j=i-1; j>0 && isspace(z[j]); j--){ z[j] = 0; } |
| 1251 | } |
| 1252 | } |
| 1253 | z[i] = 0; |
| 1254 | if( zDisplay==0 ){ |
| 1255 | zDisplay = zTarget; |
| 1256 | }else{ |
| 1257 | while( isspace(*zDisplay) ) zDisplay++; |
| 1258 | } |
| 1259 | openHyperlink(p, zTarget, zClose, sizeof(zClose)); |
| 1260 | savedState = p->state; |
| 1261 | p->state &= ~ALLOW_WIKI; |
| 1262 | p->state |= FONT_MARKUP_ONLY; |
| @@ -1265,11 +1265,11 @@ | |
| 1265 | blob_append(p->pOut, zClose, -1); |
| 1266 | break; |
| 1267 | } |
| 1268 | case TOKEN_TEXT: { |
| 1269 | int i; |
| 1270 | for(i=0; i<n && isspace(z[i]); i++){} |
| 1271 | if( i<n ) startAutoParagraph(p); |
| 1272 | blob_append(p->pOut, z, n); |
| 1273 | break; |
| 1274 | } |
| 1275 | case TOKEN_RAW: { |
| @@ -1521,11 +1521,11 @@ | |
| 1521 | int wiki_find_title(Blob *pIn, Blob *pTitle, Blob *pTail){ |
| 1522 | char *z; |
| 1523 | int i; |
| 1524 | int iStart; |
| 1525 | z = skip_bom(blob_str(pIn)); |
| 1526 | for(i=0; isspace(z[i]); i++){} |
| 1527 | if( z[i]!='<' ) return 0; |
| 1528 | i++; |
| 1529 | if( strncmp(&z[i],"title>", 6)!=0 ) return 0; |
| 1530 | iStart = i+6; |
| 1531 | for(i=iStart; z[i] && (z[i]!='<' || strncmp(&z[i],"</title>",8)!=0); i++){} |
| 1532 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -412,15 +412,15 @@ | |
| 412 | static int markupLength(const char *z){ |
| 413 | int n = 1; |
| 414 | int inparen = 0; |
| 415 | int c; |
| 416 | if( z[n]=='/' ){ n++; } |
| 417 | if( !fossil_isalpha(z[n]) ) return 0; |
| 418 | while( fossil_isalnum(z[n]) ){ n++; } |
| 419 | c = z[n]; |
| 420 | if( c=='/' && z[n+1]=='>' ){ return n+2; } |
| 421 | if( c!='>' && !fossil_isspace(c) ) return 0; |
| 422 | while( (c = z[n])!=0 && (c!='>' || inparen) ){ |
| 423 | if( c==inparen ){ |
| 424 | inparen = 0; |
| 425 | }else if( inparen==0 && (c=='"' || c=='\'') ){ |
| 426 | inparen = c; |
| @@ -437,11 +437,11 @@ | |
| 437 | ** of characters through the closing "\n". If not, return 0. |
| 438 | */ |
| 439 | static int paragraphBreakLength(const char *z){ |
| 440 | int i, n; |
| 441 | int nNewline = 1; |
| 442 | for(i=1, n=0; fossil_isspace(z[i]); i++){ |
| 443 | if( z[i]=='\n' ){ |
| 444 | nNewline++; |
| 445 | n = i; |
| 446 | } |
| 447 | } |
| @@ -482,14 +482,14 @@ | |
| 482 | */ |
| 483 | static int isElement(const char *z){ |
| 484 | int i; |
| 485 | assert( z[0]=='&' ); |
| 486 | if( z[1]=='#' ){ |
| 487 | for(i=2; fossil_isdigit(z[i]); i++){} |
| 488 | return i>2 && z[i]==';'; |
| 489 | }else{ |
| 490 | for(i=1; fossil_isalpha(z[i]); i++){} |
| 491 | return i>1 && z[i]==';'; |
| 492 | } |
| 493 | } |
| 494 | |
| 495 | /* |
| @@ -511,11 +511,11 @@ | |
| 511 | while( z[n]==' ' || z[n]=='\t' ){ |
| 512 | if( z[n]=='\t' ) i++; |
| 513 | i++; |
| 514 | n++; |
| 515 | } |
| 516 | if( i<2 || fossil_isspace(z[n]) ) return 0; |
| 517 | return n; |
| 518 | } |
| 519 | |
| 520 | /* |
| 521 | ** Check to see if the z[] string is the beginning of a enumeration value. |
| @@ -536,11 +536,11 @@ | |
| 536 | if( z[n]=='\t' ) i++; |
| 537 | i++; |
| 538 | n++; |
| 539 | } |
| 540 | if( i<2 ) return 0; |
| 541 | for(i=0; fossil_isdigit(z[n]); i++, n++){} |
| 542 | if( i==0 ) return 0; |
| 543 | if( z[n]=='.' ){ |
| 544 | n++; |
| 545 | } |
| 546 | i = 0; |
| @@ -547,11 +547,11 @@ | |
| 547 | while( z[n]==' ' || z[n]=='\t' ){ |
| 548 | if( z[n]=='\t' ) i++; |
| 549 | i++; |
| 550 | n++; |
| 551 | } |
| 552 | if( i<2 || fossil_isspace(z[n]) ) return 0; |
| 553 | return n; |
| 554 | } |
| 555 | |
| 556 | /* |
| 557 | ** Check to see if the z[] string is the beginning of an indented |
| @@ -565,11 +565,11 @@ | |
| 565 | while( z[n]==' ' || z[n]=='\t' ){ |
| 566 | if( z[n]=='\t' ) i++; |
| 567 | i++; |
| 568 | n++; |
| 569 | } |
| 570 | if( i<2 || fossil_isspace(z[n]) ) return 0; |
| 571 | return n; |
| 572 | } |
| 573 | |
| 574 | /* |
| 575 | ** Check to see if the z[] string is a wiki hyperlink. If it is, |
| @@ -612,16 +612,16 @@ | |
| 612 | if( z[0]=='\n' ){ |
| 613 | n = paragraphBreakLength(z); |
| 614 | if( n>0 ){ |
| 615 | *pTokenType = TOKEN_PARAGRAPH; |
| 616 | return n; |
| 617 | }else if( fossil_isspace(z[1]) ){ |
| 618 | *pTokenType = TOKEN_NEWLINE; |
| 619 | return 1; |
| 620 | } |
| 621 | } |
| 622 | if( (p->state & AT_NEWLINE)!=0 && fossil_isspace(z[0]) ){ |
| 623 | n = listItemLength(z, '*'); |
| 624 | if( n>0 ){ |
| 625 | *pTokenType = TOKEN_BUL_LI; |
| 626 | return n; |
| 627 | } |
| @@ -634,11 +634,11 @@ | |
| 634 | if( n>0 ){ |
| 635 | *pTokenType = TOKEN_ENUM; |
| 636 | return n; |
| 637 | } |
| 638 | } |
| 639 | if( (p->state & AT_PARAGRAPH)!=0 && fossil_isspace(z[0]) ){ |
| 640 | n = indentLength(z); |
| 641 | if( n>0 ){ |
| 642 | *pTokenType = TOKEN_INDENT; |
| 643 | return n; |
| 644 | } |
| @@ -705,37 +705,37 @@ | |
| 705 | }else{ |
| 706 | p->endTag = 0; |
| 707 | i = 1; |
| 708 | } |
| 709 | j = 0; |
| 710 | while( fossil_isalnum(z[i]) ){ |
| 711 | if( j<sizeof(zTag)-1 ) zTag[j++] = fossil_tolower(z[i]); |
| 712 | i++; |
| 713 | } |
| 714 | zTag[j] = 0; |
| 715 | p->iCode = findTag(zTag); |
| 716 | p->iType = aMarkup[p->iCode].iType; |
| 717 | p->nAttr = 0; |
| 718 | while( fossil_isspace(z[i]) ){ i++; } |
| 719 | while( p->nAttr<8 && fossil_isalpha(z[i]) ){ |
| 720 | int attrOk; /* True to preserver attribute. False to ignore it */ |
| 721 | j = 0; |
| 722 | while( fossil_isalnum(z[i]) ){ |
| 723 | if( j<sizeof(zTag)-1 ) zTag[j++] = fossil_tolower(z[i]); |
| 724 | i++; |
| 725 | } |
| 726 | zTag[j] = 0; |
| 727 | p->aAttr[p->nAttr].iACode = iACode = findAttr(zTag); |
| 728 | attrOk = iACode!=0 && (seen & aAttribute[iACode].iMask)==0; |
| 729 | while( fossil_isspace(z[i]) ){ z++; } |
| 730 | if( z[i]!='=' ){ |
| 731 | p->aAttr[p->nAttr].zValue = 0; |
| 732 | p->aAttr[p->nAttr].cTerm = 0; |
| 733 | c = 0; |
| 734 | }else{ |
| 735 | i++; |
| 736 | while( fossil_isspace(z[i]) ){ z++; } |
| 737 | if( z[i]=='"' ){ |
| 738 | i++; |
| 739 | zValue = &z[i]; |
| 740 | while( z[i] && z[i]!='"' ){ i++; } |
| 741 | }else if( z[i]=='\'' ){ |
| @@ -742,11 +742,11 @@ | |
| 742 | i++; |
| 743 | zValue = &z[i]; |
| 744 | while( z[i] && z[i]!='\'' ){ i++; } |
| 745 | }else{ |
| 746 | zValue = &z[i]; |
| 747 | while( !fossil_isspace(z[i]) && z[i]!='>' ){ z++; } |
| 748 | } |
| 749 | if( attrOk ){ |
| 750 | p->aAttr[p->nAttr].zValue = zValue; |
| 751 | p->aAttr[p->nAttr].cTerm = c = z[i]; |
| 752 | z[i] = 0; |
| @@ -755,11 +755,11 @@ | |
| 755 | } |
| 756 | if( attrOk ){ |
| 757 | seen |= aAttribute[iACode].iMask; |
| 758 | p->nAttr++; |
| 759 | } |
| 760 | while( fossil_isspace(z[i]) ){ i++; } |
| 761 | if( z[i]=='>' || (z[i]=='/' && z[i+1]=='>') ) break; |
| 762 | } |
| 763 | } |
| 764 | |
| 765 | /* |
| @@ -1067,11 +1067,11 @@ | |
| 1067 | } |
| 1068 | } |
| 1069 | }else if( g.okHistory ){ |
| 1070 | blob_appendf(p->pOut, "<a href=\"%s/info/%s\">", g.zBaseURL, zTarget); |
| 1071 | } |
| 1072 | }else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-' |
| 1073 | && db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){ |
| 1074 | blob_appendf(p->pOut, "<a href=\"%s/timeline?c=%T\">", g.zBaseURL, zTarget); |
| 1075 | }else if( strncmp(zTarget, "wiki:", 5)==0 |
| 1076 | && wiki_name_is_wellformed((const unsigned char*)zTarget) ){ |
| 1077 | zTarget += 5; |
| @@ -1245,18 +1245,18 @@ | |
| 1245 | zTarget = &z[1]; |
| 1246 | for(i=1; z[i] && z[i]!=']'; i++){ |
| 1247 | if( z[i]=='|' && zDisplay==0 ){ |
| 1248 | zDisplay = &z[i+1]; |
| 1249 | z[i] = 0; |
| 1250 | for(j=i-1; j>0 && fossil_isspace(z[j]); j--){ z[j] = 0; } |
| 1251 | } |
| 1252 | } |
| 1253 | z[i] = 0; |
| 1254 | if( zDisplay==0 ){ |
| 1255 | zDisplay = zTarget; |
| 1256 | }else{ |
| 1257 | while( fossil_isspace(*zDisplay) ) zDisplay++; |
| 1258 | } |
| 1259 | openHyperlink(p, zTarget, zClose, sizeof(zClose)); |
| 1260 | savedState = p->state; |
| 1261 | p->state &= ~ALLOW_WIKI; |
| 1262 | p->state |= FONT_MARKUP_ONLY; |
| @@ -1265,11 +1265,11 @@ | |
| 1265 | blob_append(p->pOut, zClose, -1); |
| 1266 | break; |
| 1267 | } |
| 1268 | case TOKEN_TEXT: { |
| 1269 | int i; |
| 1270 | for(i=0; i<n && fossil_isspace(z[i]); i++){} |
| 1271 | if( i<n ) startAutoParagraph(p); |
| 1272 | blob_append(p->pOut, z, n); |
| 1273 | break; |
| 1274 | } |
| 1275 | case TOKEN_RAW: { |
| @@ -1521,11 +1521,11 @@ | |
| 1521 | int wiki_find_title(Blob *pIn, Blob *pTitle, Blob *pTail){ |
| 1522 | char *z; |
| 1523 | int i; |
| 1524 | int iStart; |
| 1525 | z = skip_bom(blob_str(pIn)); |
| 1526 | for(i=0; fossil_isspace(z[i]); i++){} |
| 1527 | if( z[i]!='<' ) return 0; |
| 1528 | i++; |
| 1529 | if( strncmp(&z[i],"title>", 6)!=0 ) return 0; |
| 1530 | iStart = i+6; |
| 1531 | for(i=iStart; z[i] && (z[i]!='<' || strncmp(&z[i],"</title>",8)!=0); i++){} |
| 1532 |