search for: drop_char

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

2016 Dec 09
1
[PATCH] inspect: improve canonical_mountpoint implementation
...rc/inspect-fs-unix.c b/src/inspect-fs-unix.c index 49ac3f9..7e940d6 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -2130,44 +2130,28 @@ make_augeas_path_expression (guestfs_h *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, '/'...
2016 Dec 06
3
[PATCH 1/2] inspect: fstab: Canonicalize paths appearing in fstab.
...debug (g, "augeas pathexpr = %s", ret); return ret; } + +/* Canonicalize the path, so "///usr//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...
2016 Dec 07
0
Re: [PATCH 1/2] inspect: fstab: Canonicalize paths appearing in fstab.
...> return ret; > } > + > +/* Canonicalize the path, so "///usr//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...