aboutsummaryrefslogtreecommitdiff
path: root/console-tools/loadfont.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-09-18 01:01:02 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-09-18 01:01:02 +0000
commit72fa70af4c0c46fe2b02d3df27c24ff4d14eb505 (patch)
tree3d2699e9c10af610461fed6a419c8745bb6f196d /console-tools/loadfont.c
parent2228426512eabc05767b5abac69770e3ae9cd9bb (diff)
downloadbusybox-w32-72fa70af4c0c46fe2b02d3df27c24ff4d14eb505.tar.gz
busybox-w32-72fa70af4c0c46fe2b02d3df27c24ff4d14eb505.tar.bz2
busybox-w32-72fa70af4c0c46fe2b02d3df27c24ff4d14eb505.zip
setfont: small fixes from Vladimir
Diffstat (limited to 'console-tools/loadfont.c')
-rw-r--r--console-tools/loadfont.c8
1 files changed, 4 insertions, 4 deletions
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)
233 fd = xopen(tty_name, O_NONBLOCK); 233 fd = xopen(tty_name, O_NONBLOCK);
234 234
235 if (sizeof(CONFIG_DEFAULT_SETFONT_DIR) > 1) { // if not "" 235 if (sizeof(CONFIG_DEFAULT_SETFONT_DIR) > 1) { // if not ""
236 if (strchr(*argv, '/') != NULL) { 236 if (*argv[0] != '/') {
237 // goto default fonts location. don't die if doesn't exist 237 // goto default fonts location. don't die if doesn't exist
238 chdir(CONFIG_DEFAULT_SETFONT_DIR "/consolefonts"); 238 chdir(CONFIG_DEFAULT_SETFONT_DIR "/consolefonts");
239 // buglet: we don't return to current dir...
240 // affects "setfont FONT -m ./MAP" case
241 } 239 }
242 } 240 }
243 // load font 241 // load font
244 len = 32*1024; // can't be larger 242 len = 32*1024; // can't be larger
245 psfhdr = (struct psf_header *) xmalloc_open_zipped_read_close(*argv, &len); 243 psfhdr = (struct psf_header *) xmalloc_open_zipped_read_close(*argv, &len);
244 if (!psfhdr)
245 bb_simple_perror_msg_and_die(*argv);
246 do_load(fd, psfhdr, len); 246 do_load(fd, psfhdr, len);
247 247
248 // load the screen map, if any 248 // load the screen map, if any
@@ -251,7 +251,7 @@ int setfont_main(int argc UNUSED_PARAM, char **argv)
251 void *map; 251 void *map;
252 252
253 if (sizeof(CONFIG_DEFAULT_SETFONT_DIR) > 1) { // if not "" 253 if (sizeof(CONFIG_DEFAULT_SETFONT_DIR) > 1) { // if not ""
254 if (strchr(mapfilename, '/') != NULL) { 254 if (mapfilename[0] != '/') {
255 // goto default keymaps location 255 // goto default keymaps location
256 chdir(CONFIG_DEFAULT_SETFONT_DIR "/consoletrans"); 256 chdir(CONFIG_DEFAULT_SETFONT_DIR "/consoletrans");
257 } 257 }