Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 191

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

diff --git a/modules/lookup_file.c b/modules/lookup_file.c
index 0f4d8f1..ef35a84 100644
--- a/modules/lookup_file.c
+++ b/modules/lookup_file.c
@@ -236,11 +236,21 @@ static int read_one(FILE *f, char *key, unsigned int *k_len, char *mapent, unsig
 
 		case st_badent:
 			if (ch == '\n') {
+				nch = getc(f);
+				if (nch != EOF && isblank(nch)) {
+					ungetc(nch, f);
+					break;
+				}
+				ungetc(nch, f);
 				state = st_begin;
 				if (gotten == got_real || gotten == getting)
 					goto got_it;
+				warn(LOGOPT_ANY, MODPREFIX 
+				      "bad map entry \"%s...\" for key "
+				      "\"%s\"", mapent, key);
 				goto next;
-			}
+			} else if (!isblank(ch))
+				getting = got_nothing;
 			break;
 
 		case st_entspc:
@@ -274,24 +284,25 @@ static int read_one(FILE *f, char *key, unsigned int *k_len, char *mapent, unsig
 
 		case st_getent:
 			if (ch == '\n') {
+				if (escape == esc_all) {
+					state = st_begin;
+					warn(LOGOPT_ANY, MODPREFIX
+					     "unmatched \" in %s for key %s",
+					     mapent, key);
+					goto next;
+				}
 				nch = getc(f);
 				if (nch != EOF && isblank(nch)) {
 					ungetc(nch, f);
 					state = st_badent;
-					gotten = got_nothing;
-					warn(LOGOPT_ANY, MODPREFIX 
+					/*gotten = got_nothing;*/
+					/*warn(LOGOPT_ANY, MODPREFIX 
 					      "bad map entry \"%s...\" for key "
-					      "\"%s\"", mapent, key);
+					      "\"%s\"", mapent, key);*/
 					break;
 				}
 				ungetc(nch, f);
 				state = st_begin;
-				if (escape == esc_all) {
-					warn(LOGOPT_ANY, MODPREFIX
-					     "unmatched \" in %s for key %s",
-					     mapent, key);
-					goto next;
-				}
 				if (gotten == got_real || gotten == getting)
 					goto got_it;
 			} else if (mapent_len < MAPENT_MAX_LEN) {