Fossil SCM
Custom mimetype list now ignores one leading '.' when comparing the file extension, per forum feedback.
Commit
b55dfc97a1d8a1cc0e65909b565cc4cf82ac41aae7b793201c74f2fbd7942fa7
Parent
23a92a27cfbb361…
1 file changed
+7
+7
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -359,10 +359,17 @@ | ||
| 359 | 359 | continue; |
| 360 | 360 | } |
| 361 | 361 | } |
| 362 | 362 | switch(tokenizerState){ |
| 363 | 363 | case 0: /* This is a file extension */ |
| 364 | + if('.'==*z){ | |
| 365 | + /*ignore an optional leading dot, for compatibility | |
| 366 | + with some external mimetype lists*/; | |
| 367 | + if(++z==zEnd){ | |
| 368 | + break; | |
| 369 | + } | |
| 370 | + } | |
| 364 | 371 | if(strcmp(z,zSuffix)==0){ |
| 365 | 372 | tokenizerState = 2 /*Match: accept the next value. */; |
| 366 | 373 | }else{ |
| 367 | 374 | tokenizerState = 1 /* No match: skip the next value */; |
| 368 | 375 | } |
| 369 | 376 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -359,10 +359,17 @@ | |
| 359 | continue; |
| 360 | } |
| 361 | } |
| 362 | switch(tokenizerState){ |
| 363 | case 0: /* This is a file extension */ |
| 364 | if(strcmp(z,zSuffix)==0){ |
| 365 | tokenizerState = 2 /*Match: accept the next value. */; |
| 366 | }else{ |
| 367 | tokenizerState = 1 /* No match: skip the next value */; |
| 368 | } |
| 369 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -359,10 +359,17 @@ | |
| 359 | continue; |
| 360 | } |
| 361 | } |
| 362 | switch(tokenizerState){ |
| 363 | case 0: /* This is a file extension */ |
| 364 | if('.'==*z){ |
| 365 | /*ignore an optional leading dot, for compatibility |
| 366 | with some external mimetype lists*/; |
| 367 | if(++z==zEnd){ |
| 368 | break; |
| 369 | } |
| 370 | } |
| 371 | if(strcmp(z,zSuffix)==0){ |
| 372 | tokenizerState = 2 /*Match: accept the next value. */; |
| 373 | }else{ |
| 374 | tokenizerState = 1 /* No match: skip the next value */; |
| 375 | } |
| 376 |