MCPcopy Create free account
hub / github.com/Entware/Entware / expand_token

Function expand_token

scripts/config/lexer.lex.c:3979–4010  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3977}
3978
3979static char *expand_token(const char *in, size_t n)
3980{
3981 char *out;
3982 int c;
3983 char c2;
3984 const char *rest, *end;
3985
3986 new_string();
3987 append_string(in, n);
3988
3989 /* get the whole line because we do not know the end of token. */
3990 while ((c = input()) != EOF) {
3991 if (c == '\n') {
3992 unput(c);
3993 break;
3994 }
3995 c2 = c;
3996 append_string(&c2, 1);
3997 }
3998
3999 rest = text;
4000 out = expand_one_token(&rest);
4001
4002 /* push back unused characters to the input stream */
4003 end = rest + strlen(rest);
4004 while (end > rest)
4005 unput(*--end);
4006
4007 free(text);
4008
4009 return out;
4010}
4011
4012static void append_expanded_string(const char *str)
4013{

Callers 1

lexer.lex.cFile · 0.85

Calls 4

new_stringFunction · 0.85
append_stringFunction · 0.85
inputFunction · 0.85
expand_one_tokenFunction · 0.85

Tested by

no test coverage detected