Fossil SCM

Fix crash.

mistachkin 2019-08-06 01:49 winExtCgi
Commit 9d37ebbee6661827e6011572b3ff762292f86c7344d03f1ce47409f1957a8fb7
1 file changed +8 -6
+8 -6
--- src/file.c
+++ src/file.c
@@ -295,16 +295,18 @@
295295
** On windows, this routine returns only PERM_REG.
296296
*/
297297
int file_perm(const char *zFilename, int eFType){
298298
#if defined(_WIN32)
299299
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
+ }
306308
}
307309
}
308310
}
309311
#else
310312
if( !getStat(zFilename, RepoFILE) ){
311313
--- 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

Keyboard Shortcuts

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