summaryrefslogtreecommitdiff
path: root/libmount/src/utils.c
diff options
context:
space:
mode:
authorSami Kerola <kerolasa@iki.fi>2013-08-29 15:50:17 +0100
committerSami Kerola <kerolasa@iki.fi>2013-08-29 18:14:08 +0100
commit199e939d88333162f440ea50b83415dac625c89c (patch)
tree33b50feb3b2a065311e3c1477971e728e1fffccc /libmount/src/utils.c
parent2659a49ef0ecb269b1dc41f06ad541a264bda795 (diff)
downloadutil-linux-199e939d88333162f440ea50b83415dac625c89c.tar.gz
lib/strutils: move *swith() functions to private library
Avoid code dublication in libmount and time-util. Proposed-by: Karel Zak <kzak@redhat.com> Reference: http://markmail.org/message/h7zexvqsieqngtmx Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'libmount/src/utils.c')
-rw-r--r--libmount/src/utils.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/libmount/src/utils.c b/libmount/src/utils.c
index 4e6a1314..9f992412 100644
--- a/libmount/src/utils.c
+++ b/libmount/src/utils.c
@@ -23,37 +23,6 @@
#include "env.h"
#include "match.h"
-int endswith(const char *s, const char *sx)
-{
- ssize_t off;
-
- assert(s);
- assert(sx);
-
- off = strlen(s);
- if (!off)
- return 0;
- off -= strlen(sx);
- if (off < 0)
- return 0;
-
- return !strcmp(s + off, sx);
-}
-
-int startswith(const char *s, const char *sx)
-{
- size_t off;
-
- assert(s);
- assert(sx);
-
- off = strlen(sx);
- if (!off)
- return 0;
-
- return !strncmp(s, sx, off);
-}
-
int append_string(char **a, const char *b)
{
size_t al, bl;