Index: src/backend/installer/fn_configure.c =================================================================== RCS file: /usr/local/cvsroot/installer/src/backend/installer/fn_configure.c,v retrieving revision 1.56 diff -u -r1.56 fn_configure.c --- src/backend/installer/fn_configure.c 7 Sep 2004 22:43:01 -0000 1.56 +++ src/backend/installer/fn_configure.c 9 Sep 2004 07:08:05 -0000 @@ -557,7 +557,7 @@ struct commands *cmds; char *s; struct config_vars *rc_conf; - char filename[256]; + char filename[256], keymapname[256]; rc_conf = config_vars_new(); @@ -574,7 +574,8 @@ s); if (commands_execute(a, cmds)) { snprintf(filename, 256, "/usr/share/syscons/keymaps/%s", s); - config_var_set(rc_conf, "keymap", filename); + snprintf(keymapname, 256, filename_noext(basename(filename))); + config_var_set(rc_conf, "keymap", keymapname); config_vars_write(rc_conf, CONFIG_TYPE_SH, "%s%setc/rc.conf", a->os_root, a->cfg_root); } else { @@ -593,7 +594,7 @@ struct commands *cmds; struct config_vars *rc_conf; char *s; - char filename[256], variable[256]; + char filename[256], variable[256], fontname[256]; int by = 0; rc_conf = config_vars_new(); @@ -619,7 +620,8 @@ snprintf(variable, 256, "font8x%d", by); snprintf(filename, 256, "/usr/share/syscons/fonts/%s", s); - config_var_set(rc_conf, variable, filename); + snprintf(fontname, 256, filename_noext(basename(filename))); + config_var_set(rc_conf, variable, fontname); config_vars_write(rc_conf, CONFIG_TYPE_SH, "%s%setc/rc.conf", a->os_root, a->cfg_root); @@ -639,7 +641,7 @@ struct commands *cmds; struct config_vars *rc_conf; char *s; - char filename[256]; + char filename[256], scrnmapname[256]; rc_conf = config_vars_new(); @@ -657,7 +659,8 @@ s); if (commands_execute(a, cmds)) { snprintf(filename, 256, "/usr/share/syscons/scrnmaps/%s", s); - config_var_set(rc_conf, "scrnmap", filename); + snprintf(scrnmapname, 256, filename_noext(basename(filename))); + config_var_set(rc_conf, "scrnmap", scrnmapname); config_vars_write(rc_conf, CONFIG_TYPE_SH, "%s%setc/rc.conf", a->os_root, a->cfg_root); } else { Index: src/lib/libinstaller/functions.c =================================================================== RCS file: /usr/local/cvsroot/installer/src/lib/libinstaller/functions.c,v retrieving revision 1.19 diff -u -r1.19 functions.c --- src/lib/libinstaller/functions.c 24 Aug 2004 06:42:05 -0000 1.19 +++ src/lib/libinstaller/functions.c 9 Sep 2004 07:08:06 -0000 @@ -340,6 +340,37 @@ } /* + * Returns file name without extension. + * e.g. + * ru.koi8-r.kbd -> ru.koi8-r + * README -> README + * + * Caller is responsible for freeing the string returned. + */ +char * +filename_noext(char *filename) +{ + int i; + char *filename_noext, *p; + + filename_noext = aura_strdup(filename); + + if (strlen(filename) == 0) { + filename_noext[0] = '\0'; + return(filename_noext); + } + + p = strrchr(filename, '.'); + + if (p != NULL) { + i = strlen(filename) - strlen(p); + filename_noext[i] = 0; + } + + return(filename_noext); +} + +/* * Temp files */ Index: src/lib/libinstaller/functions.h =================================================================== RCS file: /usr/local/cvsroot/installer/src/lib/libinstaller/functions.h,v retrieving revision 1.20 diff -u -r1.20 functions.h --- src/lib/libinstaller/functions.h 24 Aug 2004 06:42:05 -0000 1.20 +++ src/lib/libinstaller/functions.h 9 Sep 2004 07:08:06 -0000 @@ -89,6 +89,7 @@ unsigned long next_power_of_two(unsigned long); char *basename(char *); char *dirname(char *); +char *filename_noext(char *); /* Temp Files */