From: Denis Vlasenko Date: Thu, 18 Sep 2008 01:01:02 +0000 (-0000) Subject: setfont: small fixes from Vladimir X-Git-Tag: 1_13_0~184 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=72fa70af4c0c46fe2b02d3df27c24ff4d14eb505;p=oweals%2Fbusybox.git setfont: small fixes from Vladimir --- diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c index 38dad3f32..4eb88e93d 100644 --- a/console-tools/loadfont.c +++ b/console-tools/loadfont.c @@ -233,16 +233,16 @@ int setfont_main(int argc UNUSED_PARAM, char **argv) fd = xopen(tty_name, O_NONBLOCK); if (sizeof(CONFIG_DEFAULT_SETFONT_DIR) > 1) { // if not "" - if (strchr(*argv, '/') != NULL) { + if (*argv[0] != '/') { // goto default fonts location. don't die if doesn't exist chdir(CONFIG_DEFAULT_SETFONT_DIR "/consolefonts"); - // buglet: we don't return to current dir... - // affects "setfont FONT -m ./MAP" case } } // load font len = 32*1024; // can't be larger psfhdr = (struct psf_header *) xmalloc_open_zipped_read_close(*argv, &len); + if (!psfhdr) + bb_simple_perror_msg_and_die(*argv); do_load(fd, psfhdr, len); // load the screen map, if any @@ -251,7 +251,7 @@ int setfont_main(int argc UNUSED_PARAM, char **argv) void *map; if (sizeof(CONFIG_DEFAULT_SETFONT_DIR) > 1) { // if not "" - if (strchr(mapfilename, '/') != NULL) { + if (mapfilename[0] != '/') { // goto default keymaps location chdir(CONFIG_DEFAULT_SETFONT_DIR "/consoletrans"); }