Re: [PATCH v2 3/3] Refactor mingw_cygwin_offset_1st_component()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Torsten,

On Fri, 7 Dec 2018, tboegi@xxxxxx wrote:

> diff --git a/compat/mingw-cygwin.c b/compat/mingw-cygwin.c
> index 5552c3ac20..c379a72775 100644
> --- a/compat/mingw-cygwin.c
> +++ b/compat/mingw-cygwin.c
> @@ -10,10 +10,8 @@ size_t mingw_cygwin_skip_dos_drive_prefix(char **path)
>  size_t mingw_cygwin_offset_1st_component(const char *path)
>  {
>  	char *pos = (char *)path;
> -
> -	/* unc paths */

This comment is still useful (and now even more correct), and should stay.

> -	if (!skip_dos_drive_prefix(&pos) &&
> -			is_dir_sep(pos[0]) && is_dir_sep(pos[1])) {
> +	if (is_dir_sep(pos[0]) && is_dir_sep(pos[1])) {
> +		/* unc path */
>  		/* skip server name */
>  		pos = strpbrk(pos + 2, "\\/");
>  		if (!pos)
> @@ -22,7 +20,8 @@ size_t mingw_cygwin_offset_1st_component(const char *path)
>  		do {
>  			pos++;
>  		} while (*pos && !is_dir_sep(*pos));
> +	} else {
> +		skip_dos_drive_prefix(&pos);
>  	}
> -

Why remove this empty line? It structures the code quite nicely.

The rest looks correct to me,
Johannes

>  	return pos + is_dir_sep(*pos) - path;
>  }
> -- 
> 2.19.0.271.gfe8321ec05
> 
> 



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux