MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / ed_digit

Function ed_digit

extern/editline/src/common.c:378–399  ·  view source on GitHub ↗

ed_digit(): * Adds to argument or enters a digit */

Source from the content-addressed store, hash-verified

376 * Adds to argument or enters a digit
377 */
378protected el_action_t
379ed_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():

Callers

nothing calls this directly

Calls 1

ed_insertFunction · 0.85

Tested by

no test coverage detected