From: J. Bruce Fields Date: Mon, 8 Mar 2010 20:02:26 +0000 (-0500) Subject: mountd: trivial: name parameters for clarity X-Git-Tag: nfs-utils-1-2-3-rc1~7 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=70c59e231e7257ac93b68ba4b844f8d10a6af4a8;p=nfs-utils.git mountd: trivial: name parameters for clarity Part of the reason for the previous bug was confusion between "subpath" and "path"; which is the shorter path, and which the longer? "child" and "parent" seem less ambiguous. Signed-off-by: J. Bruce Fields Signed-off-by: Steve Dickson --- diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index 45397db..6343325 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -614,12 +614,12 @@ static int dump_to_cache(FILE *f, char *domain, char *path, struct exportent *ex return qword_eol(f); } -static int is_subdirectory(char *subpath, char *path) +static int is_subdirectory(char *child, char *parent) { - int l = strlen(path); + int l = strlen(parent); - return strcmp(subpath, path) == 0 - || (strncmp(subpath, path, l) == 0 && subpath[l] == '/'); + return strcmp(child, parent) == 0 + || (strncmp(child, parent, l) == 0 && child[l] == '/'); } static int path_matches(nfs_export *exp, char *path)