chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow for the use of @ in remote host calls
[elogind.git]
/
src
/
shared
/
util.c
diff --git
a/src/shared/util.c
b/src/shared/util.c
index 2edf9cd8753ae8fa21edb4f08027ec5bdb54279e..d0bbf78bf371cc2340bbb7952193df5bdda12c20 100644
(file)
--- a/
src/shared/util.c
+++ b/
src/shared/util.c
@@
-5847,3
+5847,17
@@
bool id128_is_valid(const char *s) {
return true;
}
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;
+ }
+}