6
extern int (*doquote)(int);
7
extern int __needsquotes(char*, int*);
8
extern int __runeneedsquotes(Rune*, int*);
11
unquotestrdup(char *s)
16
ret = s = strdup(s); /* return unquoted copy */
20
t = s; /* s is output string, t is input string */
21
while(*t!='\0' && (quoting || (*t!=' ' && *t!='\t'))){
32
/* quoting and we're on a quote */
34
/* end of quoted section; absorb closing quote */
39
/* doubled quote; fold one quote into two */
44
memmove(s, t, strlen(t)+1);
49
unquoterunestrdup(Rune *s)
54
ret = s = runestrdup(s); /* return unquoted copy */
58
t = s; /* s is output string, t is input string */
59
while(*t!='\0' && (quoting || (*t!=' ' && *t!='\t'))){
70
/* quoting and we're on a quote */
72
/* end of quoted section; absorb closing quote */
77
/* doubled quote; fold one quote into two */
82
memmove(s, t, (runestrlen(t)+1)*sizeof(Rune));
93
if(__needsquotes(s, "elen) == 0)
96
ret = malloc(quotelen+1);
104
*u++ = r; /* double the quote */
113
quoterunestrdup(Rune *s)
119
if(__runeneedsquotes(s, "elen) == 0)
120
return runestrdup(s);
122
ret = malloc((quotelen+1)*sizeof(Rune));
130
*u++ = r; /* double the quote */