From 9bd2f93ab4cd98ea75f100f28e31bf319dbc18e6 Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Fri, 7 Jun 2002 01:04:24 +0000 Subject: [PATCH] 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. --- usr.bin/csplit/csplit.1 | 11 +++++++++++ usr.bin/csplit/csplit.c | 3 +++ 2 files changed, 14 insertions(+) diff --git a/usr.bin/csplit/csplit.1 b/usr.bin/csplit/csplit.1 index 61526eae601e..84ca52c330c5 100644 --- a/usr.bin/csplit/csplit.1 +++ b/usr.bin/csplit/csplit.1 @@ -115,6 +115,17 @@ After all the patterns have been processed, the remaining input data .Pp Requesting to split at a line before the current line number or past the 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 Split the .Xr mdoc 7 diff --git a/usr.bin/csplit/csplit.c b/usr.bin/csplit/csplit.c index f54a489937a5..5513f7b83f61 100644 --- a/usr.bin/csplit/csplit.c +++ b/usr.bin/csplit/csplit.c @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -99,6 +100,8 @@ main(int argc, char *argv[]) char *ep, *p; FILE *ofp; + setlocale(LC_ALL, ""); + kflag = sflag = 0; prefix = "xx"; sufflen = 2;