(vfs_url_split): replace the 'while' loop with strchr().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2023-04-23 12:38:18 +03:00
parent 044c035900
commit b4cf765748

View File

@ -254,12 +254,12 @@ vfs_url_split (const char *path, int default_port, vfs_url_flags_t flags)
if ((flags & URL_NOSLASH) == 0) if ((flags & URL_NOSLASH) == 0)
{ {
char *dir = pcopy; char *dir;
/* locate path component */ /* locate path component */
while (!IS_PATH_SEP (*dir) && *dir != '\0') dir = strchr (pcopy, PATH_SEP);
dir++;
if (*dir == '\0') if (dir == NULL)
path_element->path = g_strdup (PATH_SEP_STR); path_element->path = g_strdup (PATH_SEP_STR);
else else
{ {