Fossil SCM
Don't give an "ambiguous command prefix" error when reported ambiguous commands are aliases to each others. Assume alias point to same function pointer and are all consecutive in the aCommand[] list.
Commit
862ce7ce2c5d9105e560bdad91e8ee6ab7d74adb4a0a31ea13b9efa42f967523
Parent
959807e91502d64…
1 file changed
+3
-1
+3
-1
| --- src/dispatch.c | ||
| +++ src/dispatch.c | ||
| @@ -125,11 +125,13 @@ | ||
| 125 | 125 | && strncmp(zName, aCommand[lwr].zName, nName)==0; ++lwr ){ |
| 126 | 126 | if( aCommand[lwr].eCmdFlags & eType ){ |
| 127 | 127 | if( mid<0 ){ |
| 128 | 128 | mid = lwr; /* Potential ambiguous prefix */ |
| 129 | 129 | }else{ |
| 130 | - return 2; /* Confirmed ambiguous prefix */ | |
| 130 | + if( aCommand[lwr].xFunc != aCommand[mid].xFunc ){ | |
| 131 | + return 2; /* Confirmed ambiguous prefix */ | |
| 132 | + } | |
| 131 | 133 | } |
| 132 | 134 | } |
| 133 | 135 | } |
| 134 | 136 | if( mid>=0 ){ |
| 135 | 137 | *ppCmd = &aCommand[mid]; |
| 136 | 138 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -125,11 +125,13 @@ | |
| 125 | && strncmp(zName, aCommand[lwr].zName, nName)==0; ++lwr ){ |
| 126 | if( aCommand[lwr].eCmdFlags & eType ){ |
| 127 | if( mid<0 ){ |
| 128 | mid = lwr; /* Potential ambiguous prefix */ |
| 129 | }else{ |
| 130 | return 2; /* Confirmed ambiguous prefix */ |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | if( mid>=0 ){ |
| 135 | *ppCmd = &aCommand[mid]; |
| 136 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -125,11 +125,13 @@ | |
| 125 | && strncmp(zName, aCommand[lwr].zName, nName)==0; ++lwr ){ |
| 126 | if( aCommand[lwr].eCmdFlags & eType ){ |
| 127 | if( mid<0 ){ |
| 128 | mid = lwr; /* Potential ambiguous prefix */ |
| 129 | }else{ |
| 130 | if( aCommand[lwr].xFunc != aCommand[mid].xFunc ){ |
| 131 | return 2; /* Confirmed ambiguous prefix */ |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | if( mid>=0 ){ |
| 137 | *ppCmd = &aCommand[mid]; |
| 138 |