Fossil SCM
Fix crash.
Commit
9d37ebbee6661827e6011572b3ff762292f86c7344d03f1ce47409f1957a8fb7
Parent
fbe1eddaa3a020e…
1 file changed
+8
-6
+8
-6
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -295,16 +295,18 @@ | ||
| 295 | 295 | ** On windows, this routine returns only PERM_REG. |
| 296 | 296 | */ |
| 297 | 297 | int file_perm(const char *zFilename, int eFType){ |
| 298 | 298 | #if defined(_WIN32) |
| 299 | 299 | static const char *azExts[] = { ".com", ".exe", NULL }; |
| 300 | - const char *zExt = strrchr(zFilename, '.'); | |
| 301 | - if( zExt ){ | |
| 302 | - int i; | |
| 303 | - for( i=0; azExts[i]; i++ ){ | |
| 304 | - if( sqlite3_stricmp(zExt, azExts[i])==0 ){ | |
| 305 | - return PERM_EXE; | |
| 300 | + if( zFilename ){ | |
| 301 | + const char *zExt = strrchr(zFilename, '.'); | |
| 302 | + if( zExt ){ | |
| 303 | + int i; | |
| 304 | + for( i=0; azExts[i]; i++ ){ | |
| 305 | + if( sqlite3_stricmp(zExt, azExts[i])==0 ){ | |
| 306 | + return PERM_EXE; | |
| 307 | + } | |
| 306 | 308 | } |
| 307 | 309 | } |
| 308 | 310 | } |
| 309 | 311 | #else |
| 310 | 312 | if( !getStat(zFilename, RepoFILE) ){ |
| 311 | 313 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -295,16 +295,18 @@ | |
| 295 | ** On windows, this routine returns only PERM_REG. |
| 296 | */ |
| 297 | int file_perm(const char *zFilename, int eFType){ |
| 298 | #if defined(_WIN32) |
| 299 | static const char *azExts[] = { ".com", ".exe", NULL }; |
| 300 | const char *zExt = strrchr(zFilename, '.'); |
| 301 | if( zExt ){ |
| 302 | int i; |
| 303 | for( i=0; azExts[i]; i++ ){ |
| 304 | if( sqlite3_stricmp(zExt, azExts[i])==0 ){ |
| 305 | return PERM_EXE; |
| 306 | } |
| 307 | } |
| 308 | } |
| 309 | #else |
| 310 | if( !getStat(zFilename, RepoFILE) ){ |
| 311 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -295,16 +295,18 @@ | |
| 295 | ** On windows, this routine returns only PERM_REG. |
| 296 | */ |
| 297 | int file_perm(const char *zFilename, int eFType){ |
| 298 | #if defined(_WIN32) |
| 299 | static const char *azExts[] = { ".com", ".exe", NULL }; |
| 300 | if( zFilename ){ |
| 301 | const char *zExt = strrchr(zFilename, '.'); |
| 302 | if( zExt ){ |
| 303 | int i; |
| 304 | for( i=0; azExts[i]; i++ ){ |
| 305 | if( sqlite3_stricmp(zExt, azExts[i])==0 ){ |
| 306 | return PERM_EXE; |
| 307 | } |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | #else |
| 312 | if( !getStat(zFilename, RepoFILE) ){ |
| 313 |