Commit 169ee849 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

Fixed Bug #53

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@506 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 12de5ca7
No related merge requests found
Showing with 22 additions and 3 deletions
+22 -3
...@@ -85,6 +85,8 @@ ...@@ -85,6 +85,8 @@
current line to the top of the screen, which it shouldn't do. (50) current line to the top of the screen, which it shouldn't do. (50)
[FIXED] [FIXED]
- with PDCURSES, running meta-X turns off the keypad. (51) [FIXED] - with PDCURSES, running meta-X turns off the keypad. (51) [FIXED]
- Alt speller argument (-s, --speller) does not take a string argument of
more than one word. (53) [FIXED].
** Open BUGS ** ** Open BUGS **
...@@ -95,7 +97,5 @@ ...@@ -95,7 +97,5 @@
- Resizing the window completely screws up the display if in any other - Resizing the window completely screws up the display if in any other
mode than normal editing (help screen, search and replace, file mode than normal editing (help screen, search and replace, file
browser..) (52) browser..) (52)
- Alt speller argument (-s, --speller) does not take a string argument of
more than one word. (53).
$Id$ $Id$
...@@ -25,6 +25,8 @@ General ...@@ -25,6 +25,8 @@ General
- Add arg to -T help (Rocco). - Add arg to -T help (Rocco).
global_init(), handle_sigwinch() global_init(), handle_sigwinch()
- Messy loops replaced with memset calls (Rocco). - Messy loops replaced with memset calls (Rocco).
do_alt_speller()
- Added code to parse multi-word alt_speller strings.
nano 0.9.99pre1 - 01/17/2001 nano 0.9.99pre1 - 01/17/2001
General General
......
...@@ -1316,6 +1316,9 @@ int do_alt_speller(char *file_name) ...@@ -1316,6 +1316,9 @@ int do_alt_speller(char *file_name)
{ {
int alt_spell_status; int alt_spell_status;
pid_t pid_spell; pid_t pid_spell;
char *ptr;
static int arglen = 3;
static char **spellargs = (char **) NULL;
endwin(); endwin();
...@@ -1323,8 +1326,22 @@ int do_alt_speller(char *file_name) ...@@ -1323,8 +1326,22 @@ int do_alt_speller(char *file_name)
if ( (pid_spell = fork()) == 0) { if ( (pid_spell = fork()) == 0) {
/* Set up an argument list to pass the execvp function */
if (spellargs == NULL) {
spellargs = nmalloc(arglen * sizeof(char *));
spellargs[0] = strtok(alt_speller, " ");
while ((ptr = strtok(NULL, " ")) != NULL) {
arglen++;
spellargs = nrealloc(spellargs, arglen * sizeof(char *));
spellargs[arglen - 3] = ptr;
}
spellargs[arglen - 1] = NULL;
}
spellargs[arglen - 2] = file_name;
/* Start alternate spell program, we are using the PATH here!?!? */ /* Start alternate spell program, we are using the PATH here!?!? */
execlp(alt_speller, alt_speller, file_name, NULL); execvp(spellargs[0], spellargs);
/* Should not be reached, if alternate speller is found!!! */ /* Should not be reached, if alternate speller is found!!! */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment