ed_digit(): * Adds to argument or enters a digit */
| 376 | * Adds to argument or enters a digit |
| 377 | */ |
| 378 | protected el_action_t |
| 379 | ed_digit(EditLine *el, Int c) |
| 380 | { |
| 381 | |
| 382 | if (!Isdigit(c)) |
| 383 | return CC_ERROR; |
| 384 | |
| 385 | if (el->el_state.doingarg) { |
| 386 | /* if doing an arg, add this in... */ |
| 387 | if (el->el_state.lastcmd == EM_UNIVERSAL_ARGUMENT) |
| 388 | el->el_state.argument = c - '0'; |
| 389 | else { |
| 390 | if (el->el_state.argument > 1000000) |
| 391 | return CC_ERROR; |
| 392 | el->el_state.argument = |
| 393 | (el->el_state.argument * 10) + (c - '0'); |
| 394 | } |
| 395 | return CC_ARGHACK; |
| 396 | } |
| 397 | |
| 398 | return ed_insert(el, c); |
| 399 | } |
| 400 | |
| 401 | |
| 402 | /* ed_argument_digit(): |
nothing calls this directly
no test coverage detected