[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sed 3.02 and locales (patch included)
From: |
Matthias Kilian |
Subject: |
sed 3.02 and locales (patch included) |
Date: |
Sat, 24 Aug 2002 17:40:39 +0200 |
User-agent: |
Mutt/1.3.28i |
Hi!
The character classes in sed don't work correctly.
Example:
$ echo 'ä' | LC_ALL=de_DE sed 's/[[:alpha:]]/&&/'
ä
Note that, in the german locale, 'ä' is a letter, so the correct output
would be 'ää'.
Here's the most simple bug fix:
--- ../sed-3.02/sed/sed.c Fri Jul 3 03:06:26 1998
+++ ./sed/sed.c Sat Aug 24 17:25:31 2002
@@ -51,6 +51,7 @@
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
+#include "locale.h"
#include "regex-sed.h"
#include "getopt.h"
#include "basicdefs.h"
@@ -128,6 +129,8 @@
int opt;
flagT bad_input; /* If this variable is non-zero at exit, one or
more of the input files couldn't be opened. */
+
+ setlocale(LC_ALL, "");
POSIXLY_CORRECT = (getenv("POSIXLY_CORRECT") != NULL);
#ifdef STUB_FROM_RX_LIBRARY_USAGE
Regards,
Kili
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- sed 3.02 and locales (patch included),
Matthias Kilian <=