Comment out /etc/inittab entries instead of deleting them
authorArt Cancro <ajc@citadel.org>
Tue, 19 Dec 2006 03:42:29 +0000 (03:42 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 19 Dec 2006 03:42:29 +0000 (03:42 +0000)
citadel/setup.c

index 2bf31284eaa0201f7962f0093f4f8ec1661b6075..62534334d53c3aa6f46bd76577e6db6f832ec8c7 100644 (file)
@@ -419,12 +419,11 @@ void delete_inittab_entry(void)
        }
 
        while (fgets(buf, sizeof buf, infp) != NULL) {
-               if (strstr(buf, looking_for) == NULL) {
-                       fwrite(buf, strlen(buf), 1, outfp);
-               }
-               else {
+               if (strstr(buf, looking_for) != NULL) {
+                       fwrite("#", 1, 1, outfp);
                        ++changes_made;
                }
+               fwrite(buf, strlen(buf), 1, outfp);
        }
 
        fclose(infp);