do_alt_speller and nanogetstr fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@508 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
221a46e271
commit
e434b45148
|
@ -27,6 +27,10 @@ General
|
||||||
- Messy loops replaced with memset calls (Rocco).
|
- Messy loops replaced with memset calls (Rocco).
|
||||||
do_alt_speller()
|
do_alt_speller()
|
||||||
- Added code to parse multi-word alt_speller strings.
|
- Added code to parse multi-word alt_speller strings.
|
||||||
|
- Fix initialization before fork() (Rocco).
|
||||||
|
- winio.c:
|
||||||
|
nanogetstr()
|
||||||
|
- Sanity check for x overrunning the string buffer len.
|
||||||
|
|
||||||
nano 0.9.99pre1 - 01/17/2001
|
nano 0.9.99pre1 - 01/17/2001
|
||||||
General
|
General
|
||||||
|
|
29
nano.c
29
nano.c
|
@ -1322,23 +1322,22 @@ int do_alt_speller(char *file_name)
|
||||||
|
|
||||||
endwin();
|
endwin();
|
||||||
|
|
||||||
/* Start a new process for the alternate speller */
|
/* Set up an argument list to pass the execvp function */
|
||||||
|
if (spellargs == NULL) {
|
||||||
|
spellargs = nmalloc(arglen * sizeof(char *));
|
||||||
|
|
||||||
if ( (pid_spell = fork()) == 0) {
|
spellargs[0] = strtok(alt_speller, " ");
|
||||||
|
while ((ptr = strtok(NULL, " ")) != NULL) {
|
||||||
/* Set up an argument list to pass the execvp function */
|
arglen++;
|
||||||
if (spellargs == NULL) {
|
spellargs = nrealloc(spellargs, arglen * sizeof(char *));
|
||||||
spellargs = nmalloc(arglen * sizeof(char *));
|
spellargs[arglen - 3] = ptr;
|
||||||
|
|
||||||
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;
|
spellargs[arglen - 1] = NULL;
|
||||||
|
}
|
||||||
|
spellargs[arglen - 2] = file_name;
|
||||||
|
|
||||||
|
/* Start a new process for the alternate speller */
|
||||||
|
if ( (pid_spell = fork()) == 0) {
|
||||||
|
|
||||||
/* Start alternate spell program, we are using the PATH here!?!? */
|
/* Start alternate spell program, we are using the PATH here!?!? */
|
||||||
execvp(spellargs[0], spellargs);
|
execvp(spellargs[0], spellargs);
|
||||||
|
|
2
winio.c
2
winio.c
|
@ -353,6 +353,8 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
||||||
inputbuf = input_tab(inputbuf, (x - x_left),
|
inputbuf = input_tab(inputbuf, (x - x_left),
|
||||||
&tabbed, &shift);
|
&tabbed, &shift);
|
||||||
x += shift;
|
x += shift;
|
||||||
|
if (x - x_left > strlen(inputbuf))
|
||||||
|
x = strlen(inputbuf) + x_left;
|
||||||
nanoget_repaint(buf, inputbuf, x);
|
nanoget_repaint(buf, inputbuf, x);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue