From 6fc541a9b8bce4f106ebd8ea5893272a2b8f99fa Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Tue, 25 Sep 2007 16:42:59 +0000
Subject: [PATCH] Retain behavior where `rc-update del foo` deletes foo from
 all runlevels.

---
 ChangeLog       | 2 ++
 src/rc-update.c | 7 ++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index daabc819..85998aa6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
 
     Add support for describing the options in the C programs.
 
+    Retain behavior where `rc-update del foo` deletes foo from all runlevels.
+
   24 Sep 2007; Mike Frysinger <vapier@gentoo.org>:
 
     Do not require portmap in netmount when nolock option is used with nfs
diff --git a/src/rc-update.c b/src/rc-update.c
index f5d8855f..a24f982c 100644
--- a/src/rc-update.c
+++ b/src/rc-update.c
@@ -215,11 +215,8 @@ int rc_update (int argc, char **argv)
 			eerror ("%s: service `%s' does not exist", applet, service);
 		else {
 			retval = EXIT_SUCCESS;
-			if (! runlevels) {
-				runlevel = rc_get_runlevel ();
-				rc_strlist_add (&runlevels, runlevel);
-				free (runlevel);
-			}
+			if (! runlevels)
+				runlevels = rc_get_runlevels ();
 			STRLIST_FOREACH (runlevels, runlevel, i) {
 				if (action & DOADD) {
 					if (! add (runlevel, service))