summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorMatt Kraai2001-02-01 16:49:30 +0000
committerMatt Kraai2001-02-01 16:49:30 +0000
commit05e782ddd3dc58245c889529bb8aeeaddf24bf71 (patch)
tree8fbb91ca75358923724889a558c954cffdf10136 /utility.c
parentbd018b1babf0521b8e740abb6473133c1c4c35d2 (diff)
downloadbusybox-05e782ddd3dc58245c889529bb8aeeaddf24bf71.zip
busybox-05e782ddd3dc58245c889529bb8aeeaddf24bf71.tar.gz
Fix wget error message and add (and use) chomp library function.
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/utility.c b/utility.c
index 3119269..0a0e652 100644
--- a/utility.c
+++ b/utility.c
@@ -1760,6 +1760,19 @@ char *format(unsigned long val, unsigned long hr)
}
#endif
+#if defined(BB_GREP) || defined(BB_HOSTNAME) || defined(BB_SED) || defined(BB_TAR) || defined(BB_WGET) || defined(BB_XARGS)
+void chomp(char *s)
+{
+ size_t len = strlen(s);
+
+ if (len == 0)
+ return;
+
+ if (s[len-1] == '\n')
+ s[len-1] = '\0';
+}
+#endif
+
/* END CODE */
/*
Local Variables: