diff --git a/cmd.c b/cmd.c index 8496e74d64..f6bf2c5f9a 100644 --- a/cmd.c +++ b/cmd.c @@ -255,27 +255,6 @@ fetchline(void) } #endif -static char *qemu_strsep(char **input, const char *delim) -{ - char *result = *input; - if (result != NULL) { - char *p; - - for (p = result; *p != '\0'; p++) { - if (strchr(delim, *p)) { - break; - } - } - if (*p == '\0') { - *input = NULL; - } else { - *p = '\0'; - *input = p + 1; - } - } - return result; -} - char **breakline(char *input, int *count) { int c = 0; diff --git a/include/qemu-common.h b/include/qemu-common.h index d95ea1e147..ed8b6e2005 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -174,6 +174,7 @@ char *pstrcat(char *buf, int buf_size, const char *s); int strstart(const char *str, const char *val, const char **ptr); int stristart(const char *str, const char *val, const char **ptr); int qemu_strnlen(const char *s, int max_len); +char *qemu_strsep(char **input, const char *delim); time_t mktimegm(struct tm *tm); int qemu_fls(int i); int qemu_fdatasync(int fd); diff --git a/util/cutils.c b/util/cutils.c index 8f28896843..0116fcde74 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -107,6 +107,27 @@ int qemu_strnlen(const char *s, int max_len) return i; } +char *qemu_strsep(char **input, const char *delim) +{ + char *result = *input; + if (result != NULL) { + char *p; + + for (p = result; *p != '\0'; p++) { + if (strchr(delim, *p)) { + break; + } + } + if (*p == '\0') { + *input = NULL; + } else { + *p = '\0'; + *input = p + 1; + } + } + return result; +} + time_t mktimegm(struct tm *tm) { time_t t;