aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gmid.h1
-rw-r--r--puny.c2
-rw-r--r--utils.c14
3 files changed, 1 insertions, 16 deletions
diff --git a/gmid.h b/gmid.h
index 64cbc3b..a5fb2e7 100644
--- a/gmid.h
+++ b/gmid.h
@@ -453,7 +453,6 @@ int puny_decode(const char*, char*, size_t, const char**);
/* utils.c */
const char *strip_path(const char *, int);
-int starts_with(const char*, const char*);
int ends_with(const char*, const char*);
char *absolutify_path(const char*);
char *xstrdup(const char*);
diff --git a/puny.c b/puny.c
index 7c3c92e..e6ea438 100644
--- a/puny.c
+++ b/puny.c
@@ -151,7 +151,7 @@ decode(const char *str, char *out, size_t len, const char **err)
unsigned int numpoints;
const char *s;
- if (!starts_with(str, "xn--")) {
+ if (strncmp(str, "xn--", 4) != 0) {
strncpy(out, str, len);
return 1;
}
diff --git a/utils.c b/utils.c
index 4485f89..f75fa1c 100644
--- a/utils.c
+++ b/utils.c
@@ -47,20 +47,6 @@ strip_path(const char *path, int strip)
}
int
-starts_with(const char *str, const char *prefix)
-{
- size_t i;
-
- if (prefix == NULL)
- return 0;
-
- for (i = 0; prefix[i] != '\0'; ++i)
- if (str[i] != prefix[i])
- return 0;
- return 1;
-}
-
-int
ends_with(const char *str, const char *sufx)
{
size_t i, j;