diff options
author | Paul Brook <paul@codesourcery.com> | 2009-05-30 00:52:44 +0100 |
---|---|---|
committer | Paul Brook <paul@codesourcery.com> | 2009-05-30 01:59:37 +0100 |
commit | 5cea8590eaa099be8087f363f80d0e6917382385 (patch) | |
tree | 485aa34f5047dd2835642d88957d8236adf45b3c /keymaps.c | |
parent | abc0754527e30acf278765f66d2157b6c75dc549 (diff) |
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.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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; |