mirror of
https://github.com/levinsv/pgadmin3.git
synced 2026-05-15 14:15:49 -06:00
fix crush autocomplite
Исправлено падение после автозавершения после слова "create".
This commit is contained in:
parent
295b7f97d1
commit
825e80fb4f
2 changed files with 4 additions and 1 deletions
|
|
@ -329,6 +329,7 @@ typedef struct
|
|||
|
||||
static const pgsql_thing_t words_after_create[] = {
|
||||
{"AGGREGATE", NULL, &Query_for_list_of_aggregates},
|
||||
{"PUBLICATION", NULL, NULL},
|
||||
{"CAST", NULL, NULL}, /* Casts have complex structures for names, so
|
||||
* skip it */
|
||||
|
||||
|
|
|
|||
|
|
@ -384,6 +384,8 @@ static char *complete_create_command(char *text)
|
|||
if (pg_strncasecmp(text, words_after_create[i].name, string_length) == 0)
|
||||
size += strlen(words_after_create[i].name);
|
||||
}
|
||||
if (size == 0)
|
||||
return NULL;
|
||||
|
||||
r = calloc(size + i*2 + 1, 1);
|
||||
for (i = 0; words_after_create[i].name != NULL; i++)
|
||||
|
|
@ -394,7 +396,7 @@ static char *complete_create_command(char *text)
|
|||
strcat(r," \t");
|
||||
}
|
||||
}
|
||||
r[strlen(r)-1] = '\0'; /* Chop of trailing space */
|
||||
r[strlen(r)-1] = '\0'; /* Chop of trailing space */
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue