Blob Blame History Raw
autofs-5.1.3 - revert fix argc off by one in mount_autofs.c

From: Ian Kent <raven@themaw.net>

Commit 6a44f715cf to fix an off by one error in the arguments calculation
when mounting an autofs submount actually introduced an off by one error
instead of fixing one.

Revert the change.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG              |    1 +
 modules/mount_autofs.c |    8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

--- autofs-5.0.7.orig/CHANGELOG
+++ autofs-5.0.7/CHANGELOG
@@ -251,6 +251,7 @@
 - limit getgrgid_r() buffer size.
 - add congigure option for limiting getgrgid_r() stack usage.
 - fix unset tsd group name handling.
+- revert fix argc off by one in mount_autofs.c.
 
 25/07/2012 autofs-5.0.7
 =======================
--- autofs-5.0.7.orig/modules/mount_autofs.c
+++ autofs-5.0.7/modules/mount_autofs.c
@@ -181,11 +181,11 @@ int mount_mount(struct autofs_point *ap,
 
 	if (options) {
 		char *t = options;
-		while ((t = strchr(t, ',')) != NULL) {
+		do {
 			argc++;
 			if (*t == ',')
 				t++;
-		}
+		} while ((t = strchr(t, ',')) != NULL);
 	}
 	argv = (const char **) alloca((argc + 1) * sizeof(char *));
 
@@ -213,13 +213,13 @@ int mount_mount(struct autofs_point *ap,
 
 	if (options) {
 		p = options;
-		while ((p = strchr(p, ',')) != NULL) {
+		do {
 			if (*p == ',') {
 				*p = '\0';
 				p++;
 			}
 			argv[argc++] = p;
-		}
+		} while ((p = strchr(p, ',')) != NULL);
 	}
 	argv[argc] = NULL;