This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: [RFA] Preventing infinite loop in file-name completion
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Subject: Re: [RFA] Preventing infinite loop in file-name completion
- From: Elena Zannoni <ezannoni at cygnus dot com>
- Date: Thu, 6 Apr 2000 11:00:44 -0400 (EDT)
- Cc: gdb-patches at sourceware dot cygnus dot com
- References: <200004061207.IAA19010@mescaline.gnu.org>
Eli Zaretskii writes:
> The following patch prevents GDB from entering an infinite loop when
> you type e.g. "source foo<TAB>" and the first file seen by GDB happens
> to be a backup file.
>
> Okay to check in?
>
OK, (can you specify somewhere in the changelog, or in a comment, that
a backup file is one ending with '~', please?)
Thanks
Elena
> 2000-04-05 Eli Zaretskii <eliz@is.elta.co.il>
>
> * top.c (filename_completer): Set subsequent_name to 1 early on,
> to prevent an infinite loop if the first file in the directory is
> a backup file.
>
> --- gdb/top.c~0 Sat Apr 1 19:41:12 2000
> +++ gdb/top.c Wed Apr 5 21:40:32 2000
> @@ -1888,6 +1888,7 @@
> return_val[return_val_used++] = p;
> break;
> }
> + subsequent_name = 1;
> /* Like emacs, don't complete on old versions. Especially useful
> in the "source" command. */
> if (p[strlen (p) - 1] == '~')
> @@ -1917,7 +1918,6 @@
> free (p);
> }
> }
> - subsequent_name = 1;
> }
> #if 0
> /* There is no way to do this just long enough to affect quote inserting