svn commit: trunk/busybox/loginutils

vda at busybox.net vda at busybox.net
Mon Nov 27 01:04:23 UTC 2006


Author: vda
Date: 2006-11-26 17:04:23 -0800 (Sun, 26 Nov 2006)
New Revision: 16681

Log:
deluser: the same code, but a bit less obfuscated.


Modified:
   trunk/busybox/loginutils/deluser.c


Changeset:
Modified: trunk/busybox/loginutils/deluser.c
===================================================================
--- trunk/busybox/loginutils/deluser.c	2006-11-27 00:54:59 UTC (rev 16680)
+++ trunk/busybox/loginutils/deluser.c	2006-11-27 01:04:23 UTC (rev 16681)
@@ -34,28 +34,29 @@
 		}
 	}
 
-	if (!found) {
-		bb_error_msg("can't find '%s' in '%s'", login, filename);
-		if (!ENABLE_FEATURE_CLEAN_UP) return;
-		goto clean_up;
-	}
-
-	if (ENABLE_FEATURE_CLEAN_UP)
+	if (!ENABLE_FEATURE_CLEAN_UP) {
+		if (!found) {
+			bb_error_msg("can't find '%s' in '%s'", login, filename);
+			return;
+		}
+		passwd = fopen_or_warn(filename, "w");
+		if (passwd)
+			while ((line = llist_pop(&plist)))
+				fputs(line, passwd);
+	} else {
+		if (!found) {
+			bb_error_msg("can't find '%s' in '%s'", login, filename);
+			goto clean_up;
+		}
 		fclose(passwd);
-
-	passwd = fopen_or_warn(filename, "w");
-	if (passwd) {
-		if (ENABLE_FEATURE_CLEAN_UP) {
+		passwd = fopen_or_warn(filename, "w");
+		if (passwd) {
  clean_up:
 			while ((line = llist_pop(&plist))) {
 				if (found) fputs(line, passwd);
 				free(line);
 			}
 			fclose(passwd);
-		} else {
-			/* found != 0 here, no need to check */
-			while ((line = llist_pop(&plist)))
-				fputs(line, passwd);
 		}
 	}
 }




More information about the busybox-cvs mailing list