diff options
| author | Gregory Neil Shapiro <gshapiro@FreeBSD.org> | 2020-07-14 21:40:53 +0000 |
|---|---|---|
| committer | Gregory Neil Shapiro <gshapiro@FreeBSD.org> | 2020-07-14 21:40:53 +0000 |
| commit | cee0d44ab388e12fbd62fdb134d295c58901148a (patch) | |
| tree | fbe464b241337077b941be7126ad3f3f78b19f7f /libsm/string.c | |
| parent | 1c3e417caf2d11608f10043b7e70b6e7ed8711ff (diff) | |
Diffstat (limited to 'libsm/string.c')
| -rw-r--r-- | libsm/string.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libsm/string.c b/libsm/string.c index 2b06e2c7ec78..83577f19a84e 100644 --- a/libsm/string.c +++ b/libsm/string.c @@ -54,3 +54,34 @@ stripquotes(s) *q++ = c; } while (c != '\0'); } + +/* +** UNFOLDSTRIPQUOTES -- Strip quotes & quote bits from a string. +** +** Parameters: +** s -- the string to strip. +** +** Returns: +** none. +*/ + +void +unfoldstripquotes(s) + char *s; +{ + char *p, *q, c; + + if (s == NULL) + return; + + p = q = s; + do + { + c = *p++; + if (c == '\\' || c == '\n') + c = *p++; + else if (c == '"') + continue; + *q++ = c; + } while (c != '\0'); +} |
