[PATCH] Hiding temporary command from history



Hi,

Temporary commands that are executed from the user menu end up in the
history. Since HISTIGNORE is already set to ignorespace adding a space
to the temporary command hides it from the history. See attached patch.

Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research

--- src/user.c.000	2004-11-14 14:07:07.000000000 +0100
+++ src/user.c	2004-11-16 16:53:49.000000000 +0100
@@ -546,7 +546,7 @@ execute_menu_command (WEdit *edit_widget
     int  do_quote = 0;
     char prompt [80];
     int  col;
-    char *file_name;
+    char *file_name, *space_file_name;
     int run_view = 0;
 
     /* Skip menu entry title line */
@@ -632,14 +632,16 @@ execute_menu_command (WEdit *edit_widget
     }
     fclose (cmd_file);
     chmod (file_name, S_IRWXU);
+    space_file_name = g_strconcat (" ", file_name, (char *) NULL);
     if (run_view) {
 	run_view = 0;
-	view (file_name, 0, &run_view, 0);
+	view (space_file_name, 0, &run_view, 0);
     } else {
-	shell_execute (file_name, 0);
+	shell_execute (space_file_name, 0);
     }
     unlink (file_name);
     g_free (file_name);
+    g_free (space_file_name);
 }
 
 /* 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]