git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8078
d7cf8633-e32d-0410-b094-
e92efae38249
char command[512];
int c, v, a, i, cmd_len, pos, k;
int n; // nicks --blub
char command[512];
int c, v, a, i, cmd_len, pos, k;
int n; // nicks --blub
+ const char *space, *patterns;
//find what we want to complete
pos = key_linepos;
//find what we want to complete
pos = key_linepos;
if(space && pos == (space - key_lines[edit_line]) + 1)
{
strlcpy(command, key_lines[edit_line] + 1, min(sizeof(command), (unsigned int)(space - key_lines[edit_line])));
if(space && pos == (space - key_lines[edit_line]) + 1)
{
strlcpy(command, key_lines[edit_line] + 1, min(sizeof(command), (unsigned int)(space - key_lines[edit_line])));
- if(!strcmp(command, "map") || !strcmp(command, "changelevel"))
+
+ patterns = Cvar_VariableString(va("con_completion_%s", command)); // TODO maybe use a better place for this?
+ if(patterns && !*patterns)
+ patterns = NULL; // get rid of the empty string
+
+ if(!strcmp(command, "map") || !strcmp(command, "changelevel") || (patterns && !strcmp(patterns, "map")))
{
//maps search
char t[MAX_QPATH];
{
//maps search
char t[MAX_QPATH];
- const char *patterns = Cvar_VariableString(va("con_completion_%s", command)); // TODO maybe use a better place for this?
-
- if(patterns && *patterns)
{
char t[MAX_QPATH];
stringlist_t resultbuf, dirbuf;
{
char t[MAX_QPATH];
stringlist_t resultbuf, dirbuf;