Fossil SCM

Custom mimetype list now ignores one leading '.' when comparing the file extension, per forum feedback.

stephan 2020-01-23 18:12 mimetypes-setting
Commit b55dfc97a1d8a1cc0e65909b565cc4cf82ac41aae7b793201c74f2fbd7942fa7
1 file changed +7
+7
--- src/doc.c
+++ src/doc.c
@@ -359,10 +359,17 @@
359359
continue;
360360
}
361361
}
362362
switch(tokenizerState){
363363
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
+ }
364371
if(strcmp(z,zSuffix)==0){
365372
tokenizerState = 2 /*Match: accept the next value. */;
366373
}else{
367374
tokenizerState = 1 /* No match: skip the next value */;
368375
}
369376
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button