Respect LC_CTYPE and LC_COLLATE environment variables, mainly for their
effects on regular expressions. The libc regex code does not handle equivalence classes well (for example), but we do our best.
This commit is contained in:
parent
c8f927b297
commit
9bd2f93ab4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97977
@ -115,6 +115,17 @@ After all the patterns have been processed, the remaining input data
|
|||||||
.Pp
|
.Pp
|
||||||
Requesting to split at a line before the current line number or past the
|
Requesting to split at a line before the current line number or past the
|
||||||
end of the file will result in an error.
|
end of the file will result in an error.
|
||||||
|
.Sh ENVIRONMENT
|
||||||
|
The
|
||||||
|
.Ev LANG ,
|
||||||
|
.Ev LC_ALL ,
|
||||||
|
.Ev LC_COLLATE
|
||||||
|
and
|
||||||
|
.Ev LC_CTYPE
|
||||||
|
environment variables affect the execution of
|
||||||
|
.Nm
|
||||||
|
as described in
|
||||||
|
.Xr environ 7 .
|
||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
Split the
|
Split the
|
||||||
.Xr mdoc 7
|
.Xr mdoc 7
|
||||||
|
@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <locale.h>
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -99,6 +100,8 @@ main(int argc, char *argv[])
|
|||||||
char *ep, *p;
|
char *ep, *p;
|
||||||
FILE *ofp;
|
FILE *ofp;
|
||||||
|
|
||||||
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
kflag = sflag = 0;
|
kflag = sflag = 0;
|
||||||
prefix = "xx";
|
prefix = "xx";
|
||||||
sufflen = 2;
|
sufflen = 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user