1
1

* complete.c (command_completion_function): Don't stop $PATH

processing on empty entry. Interpret it as current directory.
Этот коммит содержится в:
Andrew V. Samoilov 2001-07-31 15:21:28 +00:00
родитель d83a8e7b5e
Коммит 4e15f75f32
2 изменённых файлов: 11 добавлений и 13 удалений

Просмотреть файл

@ -10,6 +10,8 @@
* widget.[ch] (label_new): Make text parameter const. * widget.[ch] (label_new): Make text parameter const.
* menu.c (create_menu): Don't localize name, it is always done. * menu.c (create_menu): Don't localize name, it is always done.
* find.c (find_parameters): Fix hotkeys duplication. * find.c (find_parameters): Fix hotkeys duplication.
* complete.c (command_completion_function): Don't stop $PATH
processing on empty entry. Interpret it as current directory.
2001-07-31 Pavel Roskin <proski@gnu.org> 2001-07-31 Pavel Roskin <proski@gnu.org>

Просмотреть файл

@ -442,6 +442,7 @@ hostname_completion_function (char *text, int state)
static char * static char *
command_completion_function (char *text, int state) command_completion_function (char *text, int state)
{ {
static char *path_end;
static int isabsolute; static int isabsolute;
static int phase; static int phase;
static int text_len; static int text_len;
@ -471,17 +472,12 @@ command_completion_function (char *text, int state)
words = bash_reserved; words = bash_reserved;
phase = 0; phase = 0;
text_len = strlen (text); text_len = strlen (text);
p = getenv ("PATH"); path = getenv ("PATH");
if (!p) if (path){
path = NULL; p = path = g_strdup (path);
else { path_end = strchr (p, 0);
path = g_malloc (strlen (p) + 2); while ((p = strchr (p, PATH_ENV_SEP))){
strcpy (path, p); *p++ = 0;
path [strlen (p) + 1] = 0;
p = strchr (path, PATH_ENV_SEP);
while (p){
*p = 0;
p = strchr (p + 1, PATH_ENV_SEP);
} }
} }
} }
@ -520,9 +516,9 @@ command_completion_function (char *text, int state)
if (!cur_word){ if (!cur_word){
char *expanded; char *expanded;
if (!*cur_path) if (cur_path >= path_end)
break; break;
expanded = tilde_expand (cur_path); expanded = tilde_expand (*cur_path ? cur_path : ".");
if (!expanded){ if (!expanded){
g_free (path); g_free (path);
path = NULL; path = NULL;