summaryrefslogtreecommitdiffstats
path: root/sys-utils/tunelp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys-utils/tunelp.c')
-rw-r--r--sys-utils/tunelp.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys-utils/tunelp.c b/sys-utils/tunelp.c
index dfb30aa67..7292a0cad 100644
--- a/sys-utils/tunelp.c
+++ b/sys-utils/tunelp.c
@@ -61,7 +61,6 @@
#include <errno.h>
#include "lp.h"
#include "nls.h"
-#include "../version.h"
struct command {
long op;
@@ -70,8 +69,6 @@ struct command {
};
-
-
void print_usage(char *progname) {
printf(_("Usage: %s <device> [ -i <IRQ> | -t <TIME> | -c <CHARS> | -w <WAIT> | \n"
" -a [on|off] | -o [on|off] | -C [on|off] | -q [on|off] | -s | \n"
@@ -95,12 +92,12 @@ void *mylloc(long size) {
return ptr;
}
-
+static char *progname;
long get_val(char *val) {
long ret;
if (!(sscanf(val, "%ld", &ret) == 1)) {
- perror(_("sscanf error"));
+ fprintf(stderr, _("%s: bad value\n"), progname);
exit(3);
}
return ret;
@@ -113,16 +110,20 @@ long get_onoff(char *val) {
return 0;
}
-
-
int main (int argc, char ** argv) {
int c, fd, irq, status, show_irq, offset = 0, retval;
- char *progname;
- char *filename;
+ char *filename, *p;
struct stat statbuf;
struct command *cmds, *cmdst;
progname = argv[0];
+ if ((p = strrchr(progname, '/')) != NULL)
+ progname = p+1;
+
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+
if (argc < 2) print_usage(progname);
cmdst = cmds = mylloc(sizeof(struct command));