Fossil SCM
Don't check for more settings names if there's an exact match. (Couldn't set autosync because it also matached autosync-tries).
Commit
c94efdf287eb9695558ca81232b830d8e3146259
Parent
7f84d2938e06e05…
1 file changed
+2
-1
M
src/db.c
+2
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2733,11 +2733,12 @@ | ||
| 2733 | 2733 | if( globalFlag && fossil_strcmp(pSetting->name, "manifest")==0 ){ |
| 2734 | 2734 | fossil_fatal("cannot set 'manifest' globally"); |
| 2735 | 2735 | } |
| 2736 | 2736 | if( unsetFlag || g.argc==4 ){ |
| 2737 | 2737 | int isManifest = fossil_strcmp(pSetting->name, "manifest")==0; |
| 2738 | - if( pSetting[1].name && fossil_strncmp(pSetting[1].name, zName, n)==0 ){ | |
| 2738 | + if( n!=strlen(pSetting[0].name) && pSetting[1].name && | |
| 2739 | + fossil_strncmp(pSetting[1].name, zName, n)==0 ){ | |
| 2739 | 2740 | Blob x; |
| 2740 | 2741 | int i; |
| 2741 | 2742 | blob_init(&x,0,0); |
| 2742 | 2743 | for(i=0; pSetting[i].name; i++){ |
| 2743 | 2744 | if( fossil_strncmp(pSetting[i].name,zName,n)!=0 ) break; |
| 2744 | 2745 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2733,11 +2733,12 @@ | |
| 2733 | if( globalFlag && fossil_strcmp(pSetting->name, "manifest")==0 ){ |
| 2734 | fossil_fatal("cannot set 'manifest' globally"); |
| 2735 | } |
| 2736 | if( unsetFlag || g.argc==4 ){ |
| 2737 | int isManifest = fossil_strcmp(pSetting->name, "manifest")==0; |
| 2738 | if( pSetting[1].name && fossil_strncmp(pSetting[1].name, zName, n)==0 ){ |
| 2739 | Blob x; |
| 2740 | int i; |
| 2741 | blob_init(&x,0,0); |
| 2742 | for(i=0; pSetting[i].name; i++){ |
| 2743 | if( fossil_strncmp(pSetting[i].name,zName,n)!=0 ) break; |
| 2744 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2733,11 +2733,12 @@ | |
| 2733 | if( globalFlag && fossil_strcmp(pSetting->name, "manifest")==0 ){ |
| 2734 | fossil_fatal("cannot set 'manifest' globally"); |
| 2735 | } |
| 2736 | if( unsetFlag || g.argc==4 ){ |
| 2737 | int isManifest = fossil_strcmp(pSetting->name, "manifest")==0; |
| 2738 | if( n!=strlen(pSetting[0].name) && pSetting[1].name && |
| 2739 | fossil_strncmp(pSetting[1].name, zName, n)==0 ){ |
| 2740 | Blob x; |
| 2741 | int i; |
| 2742 | blob_init(&x,0,0); |
| 2743 | for(i=0; pSetting[i].name; i++){ |
| 2744 | if( fossil_strncmp(pSetting[i].name,zName,n)!=0 ) break; |
| 2745 |