Fossil

Check-in [96b09d89a1]
Login

Check-in [96b09d89a1]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix an off-by-one error in the binary search for file suffixes when trying to guess the mimetype of a file. Ticket [da461aefee1351]
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 96b09d89a1525bb3cc81db9f787c91cc832b917d
User & Date: drh 2013-05-01 16:02:03.940
Context
2013-05-01
19:59
Attempt to set the repository application_id to 1598444364 (which is the same as '_FSL') before any changes to the repository. ... (check-in: 822d6f0dab user: drh tags: trunk)
16:02
Fix an off-by-one error in the binary search for file suffixes when trying to guess the mimetype of a file. Ticket [da461aefee1351] ... (check-in: 96b09d89a1 user: drh tags: trunk)
13:31
If sbs=0 and v=0, then both buttons "Side-by-side Diff" and "Unified Diff" should be shown on the /vdiff page. Note that sbs=1 implies v=1, so it is not necessary to put both parameters on any /vdiff. ... (check-in: 4e4d0fa527 user: jan.nijtmans tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/doc.c.
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
    if( zName[i]=='.' ) z = &zName[i+1];
  }
  len = strlen(z);
  if( len<sizeof(zSuffix)-1 ){
    sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z);
    for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]);
    first = 0;
    last = sizeof(aMime)/sizeof(aMime[0]);
    while( first<=last ){
      int c;
      i = (first+last)/2;
      c = fossil_strcmp(zSuffix, aMime[i].zSuffix);
      if( c==0 ) return aMime[i].zMimetype;
      if( c<0 ){
        last = i-1;







|







313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
    if( zName[i]=='.' ) z = &zName[i+1];
  }
  len = strlen(z);
  if( len<sizeof(zSuffix)-1 ){
    sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z);
    for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]);
    first = 0;
    last = sizeof(aMime)/sizeof(aMime[0]) - 1;
    while( first<=last ){
      int c;
      i = (first+last)/2;
      c = fossil_strcmp(zSuffix, aMime[i].zSuffix);
      if( c==0 ) return aMime[i].zMimetype;
      if( c<0 ){
        last = i-1;