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.

mgagnon 2022-04-05 16:49 trunk
Commit 862ce7ce2c5d9105e560bdad91e8ee6ab7d74adb4a0a31ea13b9efa42f967523
1 file changed +3 -1
+3 -1
--- src/dispatch.c
+++ src/dispatch.c
@@ -125,11 +125,13 @@
125125
&& strncmp(zName, aCommand[lwr].zName, nName)==0; ++lwr ){
126126
if( aCommand[lwr].eCmdFlags & eType ){
127127
if( mid<0 ){
128128
mid = lwr; /* Potential ambiguous prefix */
129129
}else{
130
- return 2; /* Confirmed ambiguous prefix */
130
+ if( aCommand[lwr].xFunc != aCommand[mid].xFunc ){
131
+ return 2; /* Confirmed ambiguous prefix */
132
+ }
131133
}
132134
}
133135
}
134136
if( mid>=0 ){
135137
*ppCmd = &aCommand[mid];
136138
--- 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

Keyboard Shortcuts

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