Also look for keymaps in keymaps/%s so that rdesktop can be run "in place"
without installation... I find this useful for testing and it might avoid some user complaints as well. git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@215 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
faae4044d3
commit
0e88940ee5
15
xkeymap.c
15
xkeymap.c
@ -69,7 +69,8 @@ static BOOL
|
||||
xkeymap_read(char *mapname)
|
||||
{
|
||||
FILE *fp;
|
||||
char line[KEYMAP_MAX_LINE_LENGTH], path[PATH_MAX];
|
||||
char line[KEYMAP_MAX_LINE_LENGTH];
|
||||
char path[PATH_MAX], inplace_path[PATH_MAX];
|
||||
unsigned int line_num = 0;
|
||||
unsigned int line_length = 0;
|
||||
char *keyname, *p;
|
||||
@ -84,8 +85,16 @@ xkeymap_read(char *mapname)
|
||||
fp = fopen(path, "r");
|
||||
if (fp == NULL)
|
||||
{
|
||||
error("Failed to open keymap %s\n", path);
|
||||
return False;
|
||||
/* in case we are running from the source tree */
|
||||
strcpy(inplace_path, "keymaps/");
|
||||
strncat(inplace_path, mapname, sizeof(inplace_path) - sizeof("keymaps/"));
|
||||
|
||||
fp = fopen(inplace_path, "r");
|
||||
if (fp == NULL)
|
||||
{
|
||||
error("Failed to open keymap %s\n", path);
|
||||
return False;
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: More tolerant on white space */
|
||||
|
Loading…
Reference in New Issue
Block a user