From 70c59e231e7257ac93b68ba4b844f8d10a6af4a8 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Mon, 8 Mar 2010 15:02:26 -0500 Subject: [PATCH] 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 --- utils/mountd/cache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) -- 2.39.2