aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib.c')
-rw-r--r--lib/lib.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/lib.c b/lib/lib.c
index d9bea891..aa7b1c30 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -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";