* editcmd.c (edit_block_process_cmd): Prepend space to the

command to avoid polluting bash history.  Document arguments.
Fix crash if block is 0 - not used currently.
This commit is contained in:
Pavel Roskin 2001-09-04 04:16:06 +00:00
parent eae55940fc
commit 0b245d4db4
2 changed files with 25 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2001-09-04 Pavel Roskin <proski@gnu.org>
* editcmd.c (edit_block_process_cmd): Prepend space to the
command to avoid polluting bash history. Document arguments.
Fix crash if block is 0 - not used currently.
2001-08-26 Pavel Roskin <proski@gnu.org>
* Makefile.am: Don't install libedit.a.

View File

@ -2995,13 +2995,26 @@ void edit_block_process_cmd (WEdit * edit, const char *shell_cmd, int block)
}
edit_save_block (edit, b, start_mark, end_mark);
/* run your script */
execute (catstrs (home_dir, EDIT_DIR, shell_cmd, " ",
/*
* Run script.
* Initial space is to avoid polluting bash history.
* Arguments:
* $1 - name of the edited file (to check its extention etc).
* $2 - file containing the current block.
* $3 - file where error messages should be put.
*/
execute (catstrs (" ", home_dir, EDIT_DIR, shell_cmd, " ",
edit->filename, " ", home_dir, BLOCK_FILE, " ",
home_dir, ERROR_FILE, 0));
home_dir, ERROR_FILE, NULL));
} else { /* for missing marked block run ... */
execute (catstrs (EDIT_DIR, shell_cmd));
} else {
/*
* No block selected, just execute the command for the file.
* Arguments:
* $1 - name of the edited file.
*/
execute (catstrs (" ", home_dir, EDIT_DIR, shell_cmd, " ",
edit->filename, NULL));
}
edit_refresh_cmd (edit);