diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/util.c | 14 | ||||
-rw-r--r-- | src/shared/util.h | 1 | ||||
-rw-r--r-- | src/test/test-util.c | 16 |
3 files changed, 0 insertions, 31 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index f76ed6f563..21edd3ac2f 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -5838,20 +5838,6 @@ bool id128_is_valid(const char *s) { return true; } -void parse_user_at_host(char *arg, char **user, char **host) { - assert(arg); - assert(user); - assert(host); - - *host = strchr(arg, '@'); - if (*host == NULL) - *host = arg; - else { - *host[0]++ = '\0'; - *user = arg; - } -} - int split_pair(const char *s, const char *sep, char **l, char **r) { char *x, *a, *b; diff --git a/src/shared/util.h b/src/shared/util.h index 219e4897b3..9aea3a4e50 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -833,7 +833,6 @@ static inline void _reset_locale_(struct _locale_struct_ *s) { _saved_locale_.quit = true) bool id128_is_valid(const char *s) _pure_; -void parse_user_at_host(char *arg, char **user, char **host); int split_pair(const char *s, const char *sep, char **l, char **r); diff --git a/src/test/test-util.c b/src/test/test-util.c index 9d6f4be502..cbd60d68f7 100644 --- a/src/test/test-util.c +++ b/src/test/test-util.c @@ -490,21 +490,6 @@ static void test_strrep(void) { assert_se(streq(zero, "")); } -static void test_parse_user_at_host(void) { - _cleanup_free_ char *both = strdup("waldo@waldoscomputer"); - _cleanup_free_ char *onlyhost = strdup("mikescomputer"); - char *user = NULL, *host = NULL; - - parse_user_at_host(both, &user, &host); - assert_se(streq(user, "waldo")); - assert_se(streq(host, "waldoscomputer")); - - user = host = NULL; - parse_user_at_host(onlyhost, &user, &host); - assert_se(user == NULL); - assert_se(streq(host, "mikescomputer")); -} - static void test_split_pair(void) { _cleanup_free_ char *a = NULL, *b = NULL; @@ -635,7 +620,6 @@ int main(int argc, char *argv[]) { test_parse_bytes(); test_strextend(); test_strrep(); - test_parse_user_at_host(); test_split_pair(); test_fstab_node_to_udev_node(); test_get_files_in_directory(); |