This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[RFA] Preventing infinite loop in file-name completion
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [RFA] Preventing infinite loop in file-name completion
- From: Eli Zaretskii <eliz at gnu dot org>
- Date: Thu, 6 Apr 2000 08:07:38 -0400
- Reply-to: Eli Zaretskii <eliz at is dot elta dot co dot il>
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?
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