288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
|
z = zName;
for(i=0; zName[i]; i++){
if( zName[i]=='.' ) z = &zName[i+1];
}
len = strlen(z);
if( len<sizeof(zSuffix)-1 ){
strcpy(zSuffix, 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 = strcmp(zSuffix, aMime[i].zSuffix);
|
|
|
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
|
z = zName;
for(i=0; zName[i]; i++){
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 = strcmp(zSuffix, aMime[i].zSuffix);
|
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
|
zBaseline[i] = 0;
zName += i;
while( zName[0]=='/' ){ zName++; }
if( !file_is_simple_pathname(zName) ){
goto doc_not_found;
}
if( strcmp(zBaseline,"ckout")==0 && db_open_local()==0 ){
strcpy(zBaseline,"tip");
}
if( strcmp(zBaseline,"ckout")==0 ){
/* Read from the local checkout */
char *zFullpath;
db_must_be_within_tree();
zFullpath = mprintf("%s/%s", g.zLocalRoot, zName);
if( !file_isfile(zFullpath) ){
|
|
|
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
|
zBaseline[i] = 0;
zName += i;
while( zName[0]=='/' ){ zName++; }
if( !file_is_simple_pathname(zName) ){
goto doc_not_found;
}
if( strcmp(zBaseline,"ckout")==0 && db_open_local()==0 ){
sqlite3_snprintf(sizeof(zBaseline), zBaseline, "tip");
}
if( strcmp(zBaseline,"ckout")==0 ){
/* Read from the local checkout */
char *zFullpath;
db_must_be_within_tree();
zFullpath = mprintf("%s/%s", g.zLocalRoot, zName);
if( !file_isfile(zFullpath) ){
|