Small theme fixes, and a way to change directories with typebuf

This commit is contained in:
Jaime Thomas
2008-09-12 20:13:57 +00:00
parent d92b938d63
commit 86867280b0
4 changed files with 146 additions and 33 deletions

View File

@@ -70,3 +70,56 @@ ecdb_image_init(void)
return 1;
}
int
ecdb_match_keyword(const char *chk, const char *key, int len)
{
int i;
for (i = 0; i < len; i++)
{
if (chk[i] != key[i])
return TRUE;
}
return FALSE;
}
char *
ecdb_strip_next_argument(const char *strip)
{
char *t1 = (char *)strip, *t2;
char *ret = NULL;
int len = 0, space = FALSE;
do
{
if (*t1 == ' ')
space = TRUE;
if ((*t1 != ' ') && (space == TRUE))
{
t2 = t1;
/* Find length of string to copy */
while ((*t2) && (*t2 != ' '))
{
len++;
t2++;
}
/* Given no more args */
if (!len)
return NULL;
else
len++;
/* Make a new string and copy everything over */
ret = malloc(sizeof(char) * len);
memcpy(ret, t1, len);
return ret;
}
} while ((t1) && (t1++));
return NULL;
}