MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / find_prev_word_start

Function find_prev_word_start

components/finsh/shell.c:461–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459
460#if defined(FINSH_USING_WORD_OPERATION)
461static int find_prev_word_start(const char *line, int curpos)
462{
463 if (curpos <= 0) return 0;
464
465 /* Skip whitespace */
466 while (--curpos > 0 && (line[curpos] == ' ' || line[curpos] == '\t'));
467
468 /* Find word start */
469 while (curpos > 0 && !(line[curpos] == ' ' || line[curpos] == '\t'))
470 curpos--;
471
472 return (curpos <= 0) ? 0 : curpos + 1;
473}
474
475static int find_next_word_end(const char *line, int curpos, int max)
476{

Callers 1

ifFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected