From 30dc95029e879a2ca9be652999284f7728d99f70 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Wed, 6 Jun 2018 23:12:35 +0000 Subject: [PATCH] Remove NLS support from BSD grep GNU grep as in actually in base does not have any translations support compiled in, so no functionnality loss. We do support 193 locales in base, we will never catch up on that number of translation with bsd grep. Removing NLS support make bsd grep consistent with the other binaries in base which are not translated, and also reduce a little bit the code. Reviewed by: kevans Approved by: kevans Discussed with: kevans @BSDCan Differential Revision: https://reviews.freebsd.org/D15682 --- ObsoleteFiles.inc | 11 +++++++ tools/build/mk/OptionalObsoleteFiles.inc | 10 ------- usr.bin/grep/Makefile | 6 ---- usr.bin/grep/grep.c | 37 +++++++----------------- usr.bin/grep/grep.h | 9 ------ usr.bin/grep/nls/C.msg | 13 --------- usr.bin/grep/nls/Makefile.inc | 18 ------------ usr.bin/grep/nls/es_ES.ISO8859-1.msg | 13 --------- usr.bin/grep/nls/gl_ES.ISO8859-1.msg | 13 --------- usr.bin/grep/nls/hu_HU.ISO8859-2.msg | 13 --------- usr.bin/grep/nls/ja_JP.SJIS.msg | 13 --------- usr.bin/grep/nls/ja_JP.UTF-8.msg | 13 --------- usr.bin/grep/nls/ja_JP.eucJP.msg | 13 --------- usr.bin/grep/nls/pt_BR.ISO8859-1.msg | 13 --------- usr.bin/grep/nls/ru_RU.KOI8-R.msg | 13 --------- usr.bin/grep/nls/uk_UA.UTF-8.msg | 12 -------- usr.bin/grep/nls/zh_CN.UTF-8.msg | 13 --------- usr.bin/grep/util.c | 4 +-- 18 files changed, 23 insertions(+), 214 deletions(-) delete mode 100644 usr.bin/grep/nls/C.msg delete mode 100644 usr.bin/grep/nls/Makefile.inc delete mode 100644 usr.bin/grep/nls/es_ES.ISO8859-1.msg delete mode 100644 usr.bin/grep/nls/gl_ES.ISO8859-1.msg delete mode 100644 usr.bin/grep/nls/hu_HU.ISO8859-2.msg delete mode 100644 usr.bin/grep/nls/ja_JP.SJIS.msg delete mode 100644 usr.bin/grep/nls/ja_JP.UTF-8.msg delete mode 100644 usr.bin/grep/nls/ja_JP.eucJP.msg delete mode 100644 usr.bin/grep/nls/pt_BR.ISO8859-1.msg delete mode 100644 usr.bin/grep/nls/ru_RU.KOI8-R.msg delete mode 100644 usr.bin/grep/nls/uk_UA.UTF-8.msg delete mode 100644 usr.bin/grep/nls/zh_CN.UTF-8.msg diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 82b5878cb919..18812d52341d 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -38,6 +38,17 @@ # xargs -n1 | sort | uniq -d; # done +# 20180607: remove nls support from grep +OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/grep.cat +OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/grep.cat +OLD_FILES+=usr/share/nls/ja_JP.SJIS/grep.cat +OLD_FILES+=usr/share/nls/ja_JP.eucJP/grep.cat +OLD_FILES+=usr/share/nls/gl_ES.ISO8859-1/grep.cat +OLD_FILES+=usr/share/nls/zh_CN.UTF-8/grep.cat +OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/grep.cat +OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/grep.cat +OLD_FILES+=usr/share/nls/uk_UA.UTF-8/grep.cat +OLD_FILES+=usr/share/nls/ja_JP.UTF-8/grep.cat # 20180517: retire vxge OLD_FILES+=usr/share/man/man4/if_vxge.4.gz OLD_FILES+=usr/share/man/man4/vxge.4.gz diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index d82183a7cbe2..fa250d765fe1 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -6277,7 +6277,6 @@ OLD_FILES+=usr/share/nls/el_GR.ISO8859-7/tcsh.cat OLD_FILES+=usr/share/nls/el_GR.UTF-8/tcsh.cat OLD_FILES+=usr/share/nls/en_US.ISO8859-1/ee.cat OLD_FILES+=usr/share/nls/en_US.ISO8859-15/ee.cat -OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/grep.cat OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/es_ES.ISO8859-1/tcsh.cat OLD_FILES+=usr/share/nls/es_ES.ISO8859-15/tcsh.cat @@ -6309,10 +6308,8 @@ OLD_FILES+=usr/share/nls/fr_FR.ISO8859-1/tcsh.cat OLD_FILES+=usr/share/nls/fr_FR.ISO8859-15/ee.cat OLD_FILES+=usr/share/nls/fr_FR.ISO8859-15/tcsh.cat OLD_FILES+=usr/share/nls/fr_FR.UTF-8/tcsh.cat -OLD_FILES+=usr/share/nls/gl_ES.ISO8859-1/grep.cat OLD_FILES+=usr/share/nls/gl_ES.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/ee.cat -OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/grep.cat OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/libc.cat OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/sort.cat OLD_FILES+=usr/share/nls/it_CH.ISO8859-1/tcsh.cat @@ -6322,12 +6319,9 @@ OLD_FILES+=usr/share/nls/it_IT.ISO8859-1/tcsh.cat OLD_FILES+=usr/share/nls/it_IT.ISO8859-15/libc.cat OLD_FILES+=usr/share/nls/it_IT.ISO8859-15/tcsh.cat OLD_FILES+=usr/share/nls/it_IT.UTF-8/tcsh.cat -OLD_FILES+=usr/share/nls/ja_JP.SJIS/grep.cat OLD_FILES+=usr/share/nls/ja_JP.SJIS/tcsh.cat -OLD_FILES+=usr/share/nls/ja_JP.UTF-8/grep.cat OLD_FILES+=usr/share/nls/ja_JP.UTF-8/libc.cat OLD_FILES+=usr/share/nls/ja_JP.UTF-8/tcsh.cat -OLD_FILES+=usr/share/nls/ja_JP.eucJP/grep.cat OLD_FILES+=usr/share/nls/ja_JP.eucJP/libc.cat OLD_FILES+=usr/share/nls/ja_JP.eucJP/tcsh.cat OLD_FILES+=usr/share/nls/ko_KR.UTF-8/libc.cat @@ -6338,14 +6332,12 @@ OLD_FILES+=usr/share/nls/no_NO.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/pl_PL.ISO8859-2/ee.cat OLD_FILES+=usr/share/nls/pl_PL.ISO8859-2/libc.cat OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/ee.cat -OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/grep.cat OLD_FILES+=usr/share/nls/pt_BR.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/pt_PT.ISO8859-1/ee.cat OLD_FILES+=usr/share/nls/ru_RU.CP1251/tcsh.cat OLD_FILES+=usr/share/nls/ru_RU.CP866/tcsh.cat OLD_FILES+=usr/share/nls/ru_RU.ISO8859-5/tcsh.cat OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/ee.cat -OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/grep.cat OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/libc.cat OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/tcsh.cat OLD_FILES+=usr/share/nls/ru_RU.UTF-8/tcsh.cat @@ -6354,12 +6346,10 @@ OLD_FILES+=usr/share/nls/sv_SE.ISO8859-1/libc.cat OLD_FILES+=usr/share/nls/uk_UA.ISO8859-5/tcsh.cat OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/ee.cat OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/tcsh.cat -OLD_FILES+=usr/share/nls/uk_UA.UTF-8/grep.cat OLD_FILES+=usr/share/nls/uk_UA.UTF-8/libc.cat OLD_FILES+=usr/share/nls/uk_UA.UTF-8/tcsh.cat OLD_FILES+=usr/share/nls/zh_CN.GB18030/libc.cat OLD_FILES+=usr/share/nls/zh_CN.GB2312/libc.cat -OLD_FILES+=usr/share/nls/zh_CN.UTF-8/grep.cat OLD_FILES+=usr/share/nls/zh_CN.UTF-8/libc.cat OLD_FILES+=usr/tests/bin/sh/builtins/locale1.0 .endif diff --git a/usr.bin/grep/Makefile b/usr.bin/grep/Makefile index 9eec5877e348..cc698d54d197 100644 --- a/usr.bin/grep/Makefile +++ b/usr.bin/grep/Makefile @@ -65,12 +65,6 @@ CFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DWITH_GNU LIBADD+= gnuregex .endif -.if ${MK_NLS} != "no" -.include "${.CURDIR}/nls/Makefile.inc" -.else -CFLAGS+= -DWITHOUT_NLS -.endif - HAS_TESTS= SUBDIR.${MK_TESTS}+= tests diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 3d22b3fb1259..e891ccc7592a 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -53,15 +53,6 @@ __FBSDID("$FreeBSD$"); #include "grep.h" -#ifndef WITHOUT_NLS -#include -nl_catd catalog; -#endif - -/* - * Default messags to use when NLS is disabled or no catalogue - * is found. - */ const char *errstr[] = { "", /* 1*/ "(standard input)", @@ -162,10 +153,10 @@ bool file_err; /* file reading error */ static void usage(void) { - fprintf(stderr, getstr(3), getprogname()); - fprintf(stderr, "%s", getstr(4)); - fprintf(stderr, "%s", getstr(5)); - fprintf(stderr, "%s", getstr(6)); + fprintf(stderr, errstr[3], getprogname()); + fprintf(stderr, "%s", errstr[4]); + fprintf(stderr, "%s", errstr[5]); + fprintf(stderr, "%s", errstr[6]); exit(2); } @@ -351,10 +342,6 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); -#ifndef WITHOUT_NLS - catalog = catopen("grep", NL_CAT_LOCALE); -#endif - /* Check what is the program name of the binary. In this way we can have all the funcionalities in one binary without the need of scripting and using ugly hacks. */ @@ -470,7 +457,7 @@ main(int argc, char *argv[]) else if (strcasecmp(optarg, "read") == 0) devbehave = DEV_READ; else - errx(2, getstr(2), "--devices"); + errx(2, errstr[2], "--devices"); break; case 'd': if (strcasecmp("recurse", optarg) == 0) { @@ -481,7 +468,7 @@ main(int argc, char *argv[]) else if (strcasecmp("read", optarg) == 0) dirbehave = DIR_READ; else - errx(2, getstr(2), "--directories"); + errx(2, errstr[2], "--directories"); break; case 'E': grepbehave = GREP_EXTENDED; @@ -577,9 +564,9 @@ main(int argc, char *argv[]) break; case 'V': #ifdef WITH_GNU - printf(getstr(9), getprogname(), VERSION); + printf(errstr[9], getprogname(), VERSION); #else - printf(getstr(8), getprogname(), VERSION); + printf(errstr[8], getprogname(), VERSION); #endif exit(0); case 'v': @@ -604,7 +591,7 @@ main(int argc, char *argv[]) else if (strcasecmp("text", optarg) == 0) binbehave = BINFILE_TEXT; else - errx(2, getstr(2), "--binary-files"); + errx(2, errstr[2], "--binary-files"); break; case COLOR_OPT: color = NULL; @@ -624,7 +611,7 @@ main(int argc, char *argv[]) } else if (strcasecmp("never", optarg) != 0 && strcasecmp("none", optarg) != 0 && strcasecmp("no", optarg) != 0) - errx(2, getstr(2), "--color"); + errx(2, errstr[2], "--color"); cflags &= ~REG_NOSUB; break; case LABEL_OPT: @@ -746,10 +733,6 @@ main(int argc, char *argv[]) c+= procfile(*aargv); } -#ifndef WITHOUT_NLS - catclose(catalog); -#endif - /* Find out the correct return value according to the results and the command line option. */ exit(c ? (file_err ? (qflag ? 0 : 2) : 0) : (file_err ? 2 : 1)); diff --git a/usr.bin/grep/grep.h b/usr.bin/grep/grep.h index 41a8a812309f..fde711820985 100644 --- a/usr.bin/grep/grep.h +++ b/usr.bin/grep/grep.h @@ -38,15 +38,6 @@ #include #include -#ifdef WITHOUT_NLS -#define getstr(n) errstr[n] -#else -#include - -extern nl_catd catalog; -#define getstr(n) catgets(catalog, 1, n, errstr[n]) -#endif - extern const char *errstr[]; #define VERSION "2.6.0-FreeBSD" diff --git a/usr.bin/grep/nls/C.msg b/usr.bin/grep/nls/C.msg deleted file mode 100644 index 81573b587a84..000000000000 --- a/usr.bin/grep/nls/C.msg +++ /dev/null @@ -1,13 +0,0 @@ -$ $FreeBSD$ -$ -$set 1 -$quote " -1 "(standard input)" -2 "unknown %s option" -3 "usage: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]\n" -4 "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n" -5 "\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n" -6 "\t[--null] [pattern] [file ...]\n" -7 "Binary file %s matches\n" -8 "%s (BSD grep) %s\n" -9 "%s (BSD grep, GNU compatible) %s\n" diff --git a/usr.bin/grep/nls/Makefile.inc b/usr.bin/grep/nls/Makefile.inc deleted file mode 100644 index 0433f67f31f0..000000000000 --- a/usr.bin/grep/nls/Makefile.inc +++ /dev/null @@ -1,18 +0,0 @@ -# $FreeBSD$ -NLSNAME= grep - -NLS= es_ES.ISO8859-1 -NLS+= gl_ES.ISO8859-1 -NLS+= hu_HU.ISO8859-2 -NLS+= ja_JP.eucJP -NLS+= ja_JP.SJIS -NLS+= ja_JP.UTF-8 -NLS+= pt_BR.ISO8859-1 -NLS+= ru_RU.KOI8-R -NLS+= uk_UA.UTF-8 -NLS+= zh_CN.UTF-8 - -NLSSRCDIR= ${.CURDIR}/nls -.for lang in ${NLS} -NLSSRCFILES_${lang}=${lang}.msg -.endfor diff --git a/usr.bin/grep/nls/es_ES.ISO8859-1.msg b/usr.bin/grep/nls/es_ES.ISO8859-1.msg deleted file mode 100644 index 77df985f22d0..000000000000 --- a/usr.bin/grep/nls/es_ES.ISO8859-1.msg +++ /dev/null @@ -1,13 +0,0 @@ -$ $FreeBSD$ -$ -$set 1 -$quote " -1 "(entrada estndar)" -2 "opcin desconocida de %s" -3 "uso: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A no] [-B no] [-C[no]]\n" -4 "\t[-e pauta] [-f fichero] [--binary-files=valor] [--color=cuando]\n" -5 "\t[--context[=no]] [--directories=accin] [--label] [--line-buffered]\n" -6 "\t[--null] [pauta] [fichero ...]\n" -7 "fichero binario %s se ajusta\n" -8 "%s (BSD grep) %s\n" -9 "%s (BSD grep, GNU compatible) %s\n" diff --git a/usr.bin/grep/nls/gl_ES.ISO8859-1.msg b/usr.bin/grep/nls/gl_ES.ISO8859-1.msg deleted file mode 100644 index 4cce8eb4d767..000000000000 --- a/usr.bin/grep/nls/gl_ES.ISO8859-1.msg +++ /dev/null @@ -1,13 +0,0 @@ -$ $FreeBSD$ -$ -$set 1 -$quote " -1 "(entrada estndar)" -2 "opcin descoecida de %s" -3 "uso: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A no] [-B no] [-C[no]]\n" -4 "\t[-e pauta] [-f ficheiro] [--binary-files=valor] [--color=cando]\n" -5 "\t[--context[=no]] [--directories=accin] [--label] [--line-buffered]\n" -6 "\t[--null] [pauta] [ficheiro ...]\n" -7 "ficheiro binario %s conforma\n" -8 "%s (BSD grep) %s\n" -9 "%s (BSD grep, GNU compatible) %s\n" diff --git a/usr.bin/grep/nls/hu_HU.ISO8859-2.msg b/usr.bin/grep/nls/hu_HU.ISO8859-2.msg deleted file mode 100644 index a0ca08f4ef5d..000000000000 --- a/usr.bin/grep/nls/hu_HU.ISO8859-2.msg +++ /dev/null @@ -1,13 +0,0 @@ -$ $FreeBSD$ -$ -$set 1 -$quote " -1 "(szabvnyos bemenet)" -2 "ismeretlen %s opci" -3 "hasznlat: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A szm] [-B szm] [-C[szm]]\n" -4 "\t[-e minta] [-f fjl] [--binary-files=rtk] [--color=mikor]\n" -5 "\t[--context[=szm]] [--directories=mvelet] [--label] [--line-buffered]\n" -6 "\t[--null] [minta] [fjl ...]\n" -7 "%s binris fjl illeszkedik\n" -8 "%s (BSD grep) %s\n" -9 "%s (BSD grep, GNU compatible) %s\n" diff --git a/usr.bin/grep/nls/ja_JP.SJIS.msg b/usr.bin/grep/nls/ja_JP.SJIS.msg deleted file mode 100644 index 654a1f2045fb..000000000000 --- a/usr.bin/grep/nls/ja_JP.SJIS.msg +++ /dev/null @@ -1,13 +0,0 @@ -$ $FreeBSD$ -$ -$set 1 -$quote " -1 "(W)" -2 "%s IvV̎wlɌ肪܂" -3 "g: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A ] [-B ] [-C[]]\n" -4 "\t[-e p^[] [-f t@C] [--binary-files=l] [--color=l]\n" -5 "\t[--context[=]] [--directories=] [--label] [--line-buffered]\n" -6 "\t[--null] [p^[] [t@C ...]\n" -7 "oCit@C %s Ƀ}b`܂\n" -8 "%s (BSD grep) %s\n" -9 "%s (BSD grep, GNU compatible) %s\n" diff --git a/usr.bin/grep/nls/ja_JP.UTF-8.msg b/usr.bin/grep/nls/ja_JP.UTF-8.msg deleted file mode 100644 index 77c2ca698c51..000000000000 --- a/usr.bin/grep/nls/ja_JP.UTF-8.msg +++ /dev/null @@ -1,13 +0,0 @@ -$ $FreeBSD$ -$ -$set 1 -$quote " -1 "(標準入力)" -2 "%s オプションの指定値に誤りがあります" -3 "使い方: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A 数字] [-B 数字] [-C[数字]]\n" -4 "\t[-e パターン] [-f ファイル名] [--binary-files=値] [--color=値]\n" -5 "\t[--context[=数字]] [--directories=動作] [--label] [--line-buffered]\n" -6 "\t[--null] [パターン] [ファイル名 ...]\n" -7 "バイナリファイル %s にマッチしました\n" -8 "%s (BSD grep) %s\n" -9 "%s (BSD grep, GNU compatible) %s\n" diff --git a/usr.bin/grep/nls/ja_JP.eucJP.msg b/usr.bin/grep/nls/ja_JP.eucJP.msg deleted file mode 100644 index 5e5184034421..000000000000 --- a/usr.bin/grep/nls/ja_JP.eucJP.msg +++ /dev/null @@ -1,13 +0,0 @@ -$ $FreeBSD$ -$ -$set 1 -$quote " -1 "(ɸ)" -2 "%s ץλͤ˸꤬ޤ" -3 "Ȥ: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A ] [-B ] [-C[]]\n" -4 "\t[-e ѥ] [-f ե̾] [--binary-files=] [--color=]\n" -5 "\t[--context[=]] [--directories=ư] [--label] [--line-buffered]\n" -6 "\t[--null] [ѥ] [ե̾ ...]\n" -7 "Хʥե %s ˥ޥåޤ\n" -8 "%s (BSD grep) %s\n" -9 "%s (BSD grep, GNU compatible) %s\n" diff --git a/usr.bin/grep/nls/pt_BR.ISO8859-1.msg b/usr.bin/grep/nls/pt_BR.ISO8859-1.msg deleted file mode 100644 index 7655dbcc4473..000000000000 --- a/usr.bin/grep/nls/pt_BR.ISO8859-1.msg +++ /dev/null @@ -1,13 +0,0 @@ -$ $FreeBSD$ -$ -$set 1 -$quote " -1 "(entrada padro)" -2 "opco no conhecida de %s" -3 "uso: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]\n" -4 "\t[-e padro] [-f arquivo] [--binary-files=valor] [--color=quando]\n" -5 "\t[--context[=num]] [--directories=ao] [--label] [--line-buffered]\n" -6 "\t[--null] [padro] [arquivo ...]\n" -7 "arquivo binrio %s casa com o padro\n" -8 "%s (BSD grep) %s\n" -9 "%s (BSD grep, GNU compatible) %s\n" diff --git a/usr.bin/grep/nls/ru_RU.KOI8-R.msg b/usr.bin/grep/nls/ru_RU.KOI8-R.msg deleted file mode 100644 index 7740414fc338..000000000000 --- a/usr.bin/grep/nls/ru_RU.KOI8-R.msg +++ /dev/null @@ -1,13 +0,0 @@ -$ $FreeBSD$ -$ -$set 1 -$quote " -1 "( )" -2 " %s" -3 ": %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A ] [-B ] [-C[]]\n" -4 "\t[-e ] [-f ] [--binary-files=] [--color=]\n" -5 "\t[--context[=]] [--directories=] [--label] [--line-buffered]\n" -6 "\t[--null] [] [ ...]\n" -7 " %s \n" -8 "%s (BSD grep) %s\n" -9 "%s (BSD grep, GNU compatible) %s\n" diff --git a/usr.bin/grep/nls/uk_UA.UTF-8.msg b/usr.bin/grep/nls/uk_UA.UTF-8.msg deleted file mode 100644 index 0f4650e24682..000000000000 --- a/usr.bin/grep/nls/uk_UA.UTF-8.msg +++ /dev/null @@ -1,12 +0,0 @@ -$ $FreeBSD$ -$set 1 -$quote " -1 "(стандартний ввід)" -2 "невiдома опція %s" -3 "використання: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A чис] [-B чис] [-C[чис]]\n" -4 "\t[-e шаблон] [-f файл] [--binary-files=значення] [--color=коли]\n" -5 "\t[--context[=чис] [--directories=дія] [--label] [--line-buffered]\n" -6 "\t[--null] [шаблон] [файл ...]\n" -7 "двійковий файл %s співпадає\n" -8 "%s (BSD grep) %s\n" -9 "%s (BSD grep, GNU compatible) %s\n" diff --git a/usr.bin/grep/nls/zh_CN.UTF-8.msg b/usr.bin/grep/nls/zh_CN.UTF-8.msg deleted file mode 100644 index 69ae1531b7c1..000000000000 --- a/usr.bin/grep/nls/zh_CN.UTF-8.msg +++ /dev/null @@ -1,13 +0,0 @@ -$ $FreeBSD$ -$ -$set 1 -$quote " -1 "(标准输入)" -2 "选项 %s 无法识别" -3 "用法: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A 行数] [-B 行数] [-C[行数]]\n" -4 "\t[-e 模式] [-f 文件] [--binary-files=值] [--color=何时]\n" -5 "\t[--context[=行数]] [--directories=动作] [--label] [--line-buffered]\n" -6 "\t[--null] [模式] [文件名 ...]\n" -7 "二进制文件 %s 包含模式\n" -8 "%s (BSD grep) %s\n" -9 "%s (BSD grep, GNU compatible) %s\n" diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index e53558e5e0ba..b354a7836f85 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -299,7 +299,7 @@ procfile(const char *fn) int c, t; if (strcmp(fn, "-") == 0) { - fn = label != NULL ? label : getstr(1); + fn = label != NULL ? label : errstr[1]; f = grep_open(NULL); } else { if (stat(fn, &sb) == 0) { @@ -386,7 +386,7 @@ procfile(const char *fn) printf("%s%c", fn, nullflag ? 0 : '\n'); if (c && !cflag && !lflag && !Lflag && binbehave == BINFILE_BIN && f->binary && !qflag) - printf(getstr(7), fn); + printf(errstr[7], fn); free(pc.ln.file); free(f);