summaryrefslogtreecommitdiff
path: root/loadacm.c
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-04-19 03:59:10 +0000
committerErik Andersen <andersen@codepoet.org>2000-04-19 03:59:10 +0000
commit3fe7f9f20b6562e667ff3c9388a6ce00bd1ba19f (patch)
tree98c78a2d9487f52752ed3057d9dd233be6f65161 /loadacm.c
parenta3e57ca7008cbaf612675b9de3dd18109f8150de (diff)
downloadbusybox-3fe7f9f20b6562e667ff3c9388a6ce00bd1ba19f.tar.gz
More minor updates to docs (and making apps behave as the docs
suggest they should) -Erik
Diffstat (limited to 'loadacm.c')
-rw-r--r--loadacm.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/loadacm.c b/loadacm.c
index 66f79092c..8f6923478 100644
--- a/loadacm.c
+++ b/loadacm.c
@@ -7,6 +7,7 @@
* Peter Novodvorsky <petya@logic.ru>
*/
+#include "internal.h"
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
@@ -21,6 +22,9 @@
#include <sys/ioctl.h>
#include <sys/kd.h>
+static const char loadacm_usage[] = "loadacm\n\n"
+ "Loads an acm from standard input.\n";
+
typedef unsigned short unicode;
static long int ctoi(unsigned char *s, int *is_unicode);
@@ -33,20 +37,24 @@ int loadacm_main(int argc, char **argv)
{
int fd;
+ if (argc>=2 && *argv[1]=='-') {
+ usage(loadacm_usage);
+ }
+
fd = open("/dev/tty", O_RDWR);
if (fd < 0) {
fprintf(stderr, "Error opening /dev/tty1: %s\n", strerror(errno));
- return 1;
+ return( FALSE);
}
if (screen_map_load(fd, stdin)) {
fprintf(stderr, "Error loading acm: %s\n", strerror(errno));
- return 1;
+ return( FALSE);
}
write(fd, "\033(K", 3);
- return 0;
+ return( TRUE);
}
int screen_map_load(int fd, FILE * fp)