svn commit: trunk/busybox/console-tools

vda at busybox.net vda at busybox.net
Thu Sep 18 01:01:02 UTC 2008


Author: vda
Date: 2008-09-17 18:01:02 -0700 (Wed, 17 Sep 2008)
New Revision: 23420

Log:
setfont: small fixes from Vladimir



Modified:
   trunk/busybox/console-tools/loadfont.c


Changeset:
Modified: trunk/busybox/console-tools/loadfont.c
===================================================================
--- trunk/busybox/console-tools/loadfont.c	2008-09-18 00:56:24 UTC (rev 23419)
+++ trunk/busybox/console-tools/loadfont.c	2008-09-18 01:01:02 UTC (rev 23420)
@@ -233,16 +233,16 @@
 	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 @@
 		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");
 			}




More information about the busybox-cvs mailing list