MCPcopy Create free account
hub / github.com/coreutils/coreutils / looks_like_integer

Function looks_like_integer

src/expr.c:433–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431/* Return true if CP takes the form of an integer. */
432
433ATTRIBUTE_PURE
434static bool
435looks_like_integer (char const *cp)
436{
437 cp += (*cp == '-');
438
439 do
440 if (! c_isdigit (*cp))
441 return false;
442 while (*++cp);
443
444 return true;
445}
446
447/* Coerce V to a string value (can't fail). */
448

Callers 2

toarithFunction · 0.85
eval2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected