Re: [PATCH] libmount: after colon, ignore double slashes in path start

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

 



On Wed, Jul 20, 2016 at 02:36:09PM +0200, Ales Novak wrote:
> +/*
> + * Compare two strings for equality, ignoring at most one trailing
> + * slash, and furthermore if there are double slashes right after
> + * the ':' in the string, it ignores them. That is, these strings
> + * are equal:
> + *   host:/path
> + *   host://path
> + *   host:/path/
> + *   host://path/
> + */
> +int streq_except_redundant_slashes(const char *s1, const char *s2)

Would be better to have a generic function streq_path() to compare
paths?

 foo///bar/aaa
 foo/bar/aaa
 foo/bar/aaa//

... all are the same.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux