search for: canonical_mountpoint_recursive

Displaying 3 results from an estimated 3 matches for "canonical_mountpoint_recursive".

2016 Dec 09
1
[PATCH] inspect: improve canonical_mountpoint implementation
...*g, const char **configfiles) * the same length or shorter than the argument passed. */ static void -drop_char (char *mp) +canonical_mountpoint (char *s) { - size_t len = strlen (mp); - memmove (&mp[0], &mp[1], len); -} + size_t len = strlen (s); + char *orig = s; -static void -canonical_mountpoint_recursive (char *mp) -{ - if (mp[0] == '\0') - return; + s = strchr (s, '/'); + while (s != NULL && *s != 0) { + char *pos = s + 1; + char *p = pos; + /* Find how many consecutive slashes are there after the one found, + * and shift the characters after them accordi...
2016 Dec 06
3
[PATCH 1/2] inspect: fstab: Canonicalize paths appearing in fstab.
...local//" -> "/usr/local" + * + * The path is modified in place because the result is always + * the same length or shorter than the argument passed. + */ +static void +drop_char (char *mp) +{ + size_t len = strlen (mp); + memmove (&mp[0], &mp[1], len); +} + +static void +canonical_mountpoint_recursive (char *mp) +{ + if (mp[0] == '\0') + return; + + /* Remove trailing slashes. */ + if (mp[0] == '/' && mp[1] == '\0') { + mp[0] = '\0'; + return; + } + + /* Replace multiple slashes with single slashes. */ + if (mp[0] == '/' && m...
2016 Dec 07
0
Re: [PATCH 1/2] inspect: fstab: Canonicalize paths appearing in fstab.
...path is modified in place because the result is always > + * the same length or shorter than the argument passed. > + */ > +static void > +drop_char (char *mp) > +{ > + size_t len = strlen (mp); > + memmove (&mp[0], &mp[1], len); > +} > + > +static void > +canonical_mountpoint_recursive (char *mp) > +{ > + if (mp[0] == '\0') > + return; > + > + /* Remove trailing slashes. */ > + if (mp[0] == '/' && mp[1] == '\0') { > + mp[0] = '\0'; > + return; > + } > + > + /* Replace multiple slashes with sing...