mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
(vfs_url_split): replace the 'while' loop with strchr().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
044c035900
commit
b4cf765748
@ -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
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user