MCPcopy Index your code
hub / github.com/NetHack/NetHack / trimspaces

Function trimspaces

src/hacklib.c:163–176  ·  view source on GitHub ↗

skip leading whitespace; remove trailing whitespace, in place */

Source from the content-addressed store, hash-verified

161
162/* skip leading whitespace; remove trailing whitespace, in place */
163char *
164trimspaces(char *txt)
165{
166 char *end;
167
168 /* leading whitespace will remain in the buffer */
169 while (*txt == ' ' || *txt == '\t')
170 txt++;
171 end = eos(txt);
172 while (--end >= txt && (*end == ' ' || *end == '\t'))
173 *end = '\0';
174
175 return txt;
176}
177
178/* remove \n from end of line; remove \r too if one is there */
179char *

Callers 11

curses_status_updateFunction · 0.85
X11_yn_function_coreFunction · 0.85
optfn_autounlockFunction · 0.85
txt2keyFunction · 0.85
parsebindingsFunction · 0.85
query_annotationFunction · 0.85
parse_status_hl2Function · 0.85
status_hilite_menu_addFunction · 0.85
genl_player_setupFunction · 0.85
is_config_sectionFunction · 0.85
parseautocompleteFunction · 0.85

Calls 1

eosFunction · 0.85

Tested by

no test coverage detected