aboutsummaryrefslogtreecommitdiff
path: root/keymaps.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2009-05-30 00:52:44 +0100
committerPaul Brook <paul@codesourcery.com>2009-05-30 01:59:37 +0100
commit5cea8590eaa099be8087f363f80d0e6917382385 (patch)
tree485aa34f5047dd2835642d88957d8236adf45b3c /keymaps.c
parentabc0754527e30acf278765f66d2157b6c75dc549 (diff)
downloadqemu-5cea8590eaa099be8087f363f80d0e6917382385.zip
qemu-5cea8590eaa099be8087f363f80d0e6917382385.tar.gz
qemu-5cea8590eaa099be8087f363f80d0e6917382385.tar.bz2
Use relative path for bios
Look for bios and other support files relative to qemu binary, rather than a hardcoded prefix. Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'keymaps.c')
-rw-r--r--keymaps.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/keymaps.c b/keymaps.c
index 3b86dc1..23db4a0 100644
--- a/keymaps.c
+++ b/keymaps.c
@@ -64,20 +64,20 @@ static kbd_layout_t *parse_keyboard_layout(const name2keysym_t *table,
kbd_layout_t * k)
{
FILE *f;
- char file_name[1024];
+ char * filename;
char line[1024];
int len;
- snprintf(file_name, sizeof(file_name),
- "%s/keymaps/%s", bios_dir, language);
+ filename = qemu_find_file(QEMU_FILE_TYPE_KEYMAP, language);
if (!k)
k = qemu_mallocz(sizeof(kbd_layout_t));
- if (!(f = fopen(file_name, "r"))) {
+ if (!(filename && (f = fopen(filename, "r")))) {
fprintf(stderr,
- "Could not read keymap file: '%s'\n", file_name);
+ "Could not read keymap file: '%s'\n", language);
return 0;
}
+ qemu_free(filename);
for(;;) {
if (fgets(line, 1024, f) == NULL)
break;