Rev 601 | Rev 603 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 601 | Rev 602 | ||
|---|---|---|---|
| Line 213... | Line 213... | ||
| 213 | found++; |
213 | found++; |
| 214 | } |
214 | } |
| 215 | if (!found) |
215 | if (!found) |
| 216 | return 0; |
216 | return 0; |
| 217 | 217 | ||
| 218 | if (found > 1) { |
218 | if (found > 1 && !strlen(output)) { |
| 219 | printf("\n"); |
219 | printf("\n"); |
| 220 | startpos = NULL; |
220 | startpos = NULL; |
| 221 | while ((foundtxt = cmdtab_search_one(name, &startpos))) { |
221 | while ((foundtxt = cmdtab_search_one(name, &startpos))) { |
| 222 | cmd_info_t *hlp; |
222 | cmd_info_t *hlp; |
| 223 | hlp = list_get_instance(startpos, cmd_info_t, link); |
223 | hlp = list_get_instance(startpos, cmd_info_t, link); |
| Line 284... | Line 284... | ||
| 284 | 284 | ||
| 285 | if (found == 0) |
285 | if (found == 0) |
| 286 | continue; |
286 | continue; |
| 287 | for (i=0;tmp[i] && curlen < MAX_CMDLINE;i++,curlen++) |
287 | for (i=0;tmp[i] && curlen < MAX_CMDLINE;i++,curlen++) |
| 288 | insert_char(current, tmp[i], i+position); |
288 | insert_char(current, tmp[i], i+position); |
| - | 289 | ||
| 289 | if (found == 1) { /* One match */ |
290 | if (strlen(tmp) || found==1) { /* If we have a hint */ |
| 290 | for (i=position;i<curlen;i++) |
291 | for (i=position;i<curlen;i++) |
| 291 | putchar(current[i]); |
292 | putchar(current[i]); |
| 292 | position += strlen(tmp); |
293 | position += strlen(tmp); |
| 293 | /* Add space to end */ |
294 | /* Add space to end */ |
| - | 295 | if (found == 1 && position == curlen && \ |
|
| 294 | if (position == curlen && curlen < MAX_CMDLINE) { |
296 | curlen < MAX_CMDLINE) { |
| 295 | current[position] = ' '; |
297 | current[position] = ' '; |
| 296 | curlen++; |
298 | curlen++; |
| 297 | position++; |
299 | position++; |
| 298 | putchar(' '); |
300 | putchar(' '); |
| 299 | } |
301 | } |
| 300 | } else { |
302 | } else { /* No hint, table was printed */ |
| 301 | printf("%s> ", prompt); |
303 | printf("%s> ", prompt); |
| 302 | for (i=0; i<curlen;i++) |
304 | for (i=0; i<curlen;i++) |
| 303 | putchar(current[i]); |
305 | putchar(current[i]); |
| 304 | position += strlen(tmp); |
306 | position += strlen(tmp); |
| 305 | } |
307 | } |