Re: [PATCH] fix crash in path.c on Windows

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

 



René Scharfe <rene.scharfe@xxxxxxxxxxxxxx> writes:

> @@ -387,7 +387,7 @@ int normalize_absolute_path(char *buf, const char *path)
>  	assert(path);
>  
>  	while (*comp_start) {
> -		assert(*comp_start == '/');
> +		assert(is_absolute_path(comp_start));
>  		while (*++comp_end && *comp_end != '/')
>  			; /* nothing */
>  		comp_len = comp_end - comp_start;

This change does not make sense to me.  The assert is about the initial
iteration beginning at the "root" level, and at the same time previous
iteration ended at dir_sep.  On mingw you would probably need these two as
separate tests.  In other words, I would understand if the fix were like
this:

	if (it begins with dos_prefix) {
        	/* this is never true outside windows */
		copy the dos prefix out and advance comp_start as
        	necessary;
	}
        while (*comp_start) {
        	assert(is_dir_sep(*comp_start));
                while (*++comp_end && !is_dir_sep(*comp_end))
                	; /* nothing */
		...
	}

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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