summaryrefslogtreecommitdiffstats
path: root/text-utils/ul.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:39 +0100
committerKarel Zak2006-12-07 00:25:39 +0100
commit7eda085c41faa3445b4b168ce78ab18dab87d98a (patch)
treeeb8da4baebd0af68fa84818d3d51b4a3714667fc /text-utils/ul.c
parentImported from util-linux-2.9i tarball. (diff)
downloadkernel-qcow2-util-linux-7eda085c41faa3445b4b168ce78ab18dab87d98a.tar.gz
kernel-qcow2-util-linux-7eda085c41faa3445b4b168ce78ab18dab87d98a.tar.xz
kernel-qcow2-util-linux-7eda085c41faa3445b4b168ce78ab18dab87d98a.zip
Imported from util-linux-2.9v tarball.
Diffstat (limited to 'text-utils/ul.c')
-rw-r--r--text-utils/ul.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/text-utils/ul.c b/text-utils/ul.c
index 8da3b3f7c..a99de9d88 100644
--- a/text-utils/ul.c
+++ b/text-utils/ul.c
@@ -34,14 +34,18 @@
/*
** modified by Kars de Jong <jongk@cs.utwente.nl> to use terminfo instead
** of termcap.
+ 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
+ - added Native Language Support
+
*/
#include <stdio.h>
#include <unistd.h> /* for getopt(), isatty() */
-#include <string.h> /* for bzero() */
+#include <string.h> /* for bzero(), strcpy() */
#include <term.h> /* for setupterm() */
#include <stdlib.h> /* for getenv() */
#include <limits.h> /* for INT_MAX */
+#include "nls.h"
void filter(FILE *f);
void flushln(void);
@@ -98,6 +102,10 @@ int main(int argc, char **argv)
char *termtype;
FILE *f;
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+
termtype = getenv("TERM");
if (termtype == NULL || (argv[0][0] == 'c' && !isatty(1)))
termtype = "lpr";
@@ -114,7 +122,7 @@ int main(int argc, char **argv)
default:
fprintf(stderr,
- "usage: %s [ -i ] [ -tTerm ] file...\n",
+ _("usage: %s [ -i ] [ -tTerm ] file...\n"),
argv[0]);
exit(1);
}
@@ -125,7 +133,7 @@ int main(int argc, char **argv)
break;
default:
- fprintf(stderr,"trouble reading terminfo");
+ fprintf(stderr,_("trouble reading terminfo"));
/* fall through to ... */
case 0:
@@ -212,7 +220,7 @@ void filter(FILE *f)
default:
fprintf(stderr,
- "Unknown escape sequence in input: %o, %o\n",
+ _("Unknown escape sequence in input: %o, %o\n"),
IESC, c);
exit(1);
}
@@ -361,7 +369,7 @@ void initbuf()
obuflen = INITBUF;
obuf = malloc(sizeof(struct CHAR) * obuflen);
if (obuf == NULL) {
- fprintf(stderr, "Unable to allocate buffer.\n");
+ fprintf(stderr, _("Unable to allocate buffer.\n"));
exit(1);
}
}
@@ -518,7 +526,7 @@ void setcol(int newcol)
/* Paranoid check for obuflen == INT_MAX. */
if (obuflen == INT_MAX) {
fprintf(stderr,
- "Input line too long.\n");
+ _("Input line too long.\n"));
exit(1);
}
@@ -531,7 +539,7 @@ void setcol(int newcol)
obuf = realloc(obuf, sizeof(struct CHAR) * obuflen);
if (obuf == NULL) {
fprintf(stderr,
- "Out of memory when growing buffer.\n");
+ _("Out of memory when growing buffer.\n"));
exit(1);
}
}