Blame SOURCES/autofs-5.1.3-revert-fix-argc-off-by-one-in-mount_autofs_c.patch

304803
autofs-5.1.3 - revert fix argc off by one in mount_autofs.c
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
Commit 6a44f715cf to fix an off by one error in the arguments calculation
304803
when mounting an autofs submount actually introduced an off by one error
304803
instead of fixing one.
304803
304803
Revert the change.
304803
304803
Signed-off-by: Ian Kent <raven@themaw.net>
304803
---
304803
 CHANGELOG              |    1 +
304803
 modules/mount_autofs.c |    8 ++++----
304803
 2 files changed, 5 insertions(+), 4 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -256,6 +256,7 @@
304803
 - fix typos in autofs man pages.
304803
 - fix some man page problems.
304803
 - allow dot in OPTIONSTR value lexer pattern.
304803
+- revert fix argc off by one in mount_autofs.c.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/modules/mount_autofs.c
304803
+++ autofs-5.0.7/modules/mount_autofs.c
304803
@@ -181,11 +181,11 @@ int mount_mount(struct autofs_point *ap,
304803
 
304803
 	if (options) {
304803
 		char *t = options;
304803
-		while ((t = strchr(t, ',')) != NULL) {
304803
+		do {
304803
 			argc++;
304803
 			if (*t == ',')
304803
 				t++;
304803
-		}
304803
+		} while ((t = strchr(t, ',')) != NULL);
304803
 	}
304803
 	argv = (const char **) alloca((argc + 1) * sizeof(char *));
304803
 
304803
@@ -213,13 +213,13 @@ int mount_mount(struct autofs_point *ap,
304803
 
304803
 	if (options) {
304803
 		p = options;
304803
-		while ((p = strchr(p, ',')) != NULL) {
304803
+		do {
304803
 			if (*p == ',') {
304803
 				*p = '\0';
304803
 				p++;
304803
 			}
304803
 			argv[argc++] = p;
304803
-		}
304803
+		} while ((p = strchr(p, ',')) != NULL);
304803
 	}
304803
 	argv[argc] = NULL;
304803