diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lib.c | 8 | ||||
-rw-r--r-- | lib/lib.h | 1 |
2 files changed, 9 insertions, 0 deletions
@@ -342,6 +342,14 @@ char *strlower(char *s) return try; } +char *chomp(char *s) +{ + char *p = strrchr(s, '\n'); + + if (p) *p = 0; + return s; +} + int unescape(char c) { char *from = "\\abefnrtv", *to = "\\\a\b\033\f\n\r\t\v"; @@ -168,6 +168,7 @@ long atolx(char *c); long atolx_range(char *numstr, long low, long high); int stridx(char *haystack, char needle); char *strlower(char *s); +char *chomp(char *s); int unescape(char c); int strstart(char **a, char *b); off_t fdlength(int fd); |