diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-06-19 21:24:19 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-06-19 21:24:19 +0300 |
commit | 09a6e6fecf9691ea9a0ceb2aef26197f821868cd (patch) | |
tree | 02e9f3385750894a46752a840376fab4e35677c8 | |
parent | f8ec28a30e98cad325d18478a3d054b8c30a3129 (diff) | |
download | egawk-09a6e6fecf9691ea9a0ceb2aef26197f821868cd.tar.gz egawk-09a6e6fecf9691ea9a0ceb2aef26197f821868cd.tar.bz2 egawk-09a6e6fecf9691ea9a0ceb2aef26197f821868cd.zip |
Fix bug with --characters-as-bytes.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | main.c | 5 | ||||
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 11 | ||||
-rw-r--r-- | test/Makefile.in | 12 |
5 files changed, 35 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2012-06-19 Arnold D. Robbins <arnold@skeeve.com> + + * main.c (main): Do setlocale to "C" if --characters-as-bytes. + Thanks to "SP" <sp0sp0sp@gmail.com> for the bug report. + 2012-05-09 Arnold D. Robbins <arnold@skeeve.com> * configure.ac: Added AC_HEADER_STDBOOL @@ -559,9 +559,12 @@ out: #if MBS_SUPPORT if (do_binary) { if (do_posix) - warning(_("`--posix' overrides `--binary'")); + warning(_("`--posix' overrides `--characters-as-bytes'")); else gawk_mb_cur_max = 1; /* hands off my data! */ +#if defined(LC_ALL) + setlocale(LC_ALL, "C"); +#endif } #endif diff --git a/test/ChangeLog b/test/ChangeLog index 06d9020f..272e7cf2 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2012-06-19 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (charasbytes): New test. + * charasbytes.awk, charasbytes.in, charasbytes.ok: New files. + 2012-05-20 Arnold D. Robbins <arnold@skeeve.com> * jarebug.sh: New file. Handles Mac OS X also. diff --git a/test/Makefile.am b/test/Makefile.am index 5ff35012..43cc8f9c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -119,6 +119,9 @@ EXTRA_DIST = \ beginfile2.ok \ beginfile2.sh \ binmode1.ok \ + charasbytes.awk \ + charasbytes.in \ + charasbytes.ok \ childin.awk \ childin.in \ childin.ok \ @@ -831,7 +834,7 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ - backw badargs beginfile1 beginfile2 binmode1 \ + backw badargs beginfile1 beginfile2 binmode1 charasbytes \ clos1way delsub devfd devfd1 devfd2 dumpvars exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ fwtest fwtest2 fwtest3 \ @@ -1459,6 +1462,12 @@ jarebug:: @$(srcdir)/$@.sh "$(AWKPROG)" "$(srcdir)/$@.awk" "$(srcdir)/$@.in" "_$@" @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +charasbytes: + @echo $@ + @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ + AWKPATH=$(srcdir) $(AWK) -b -f $@.awk $(srcdir)/$@.in | \ + od -c -t x1 >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index 171428bb..0e4cc757 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -324,6 +324,9 @@ EXTRA_DIST = \ beginfile2.ok \ beginfile2.sh \ binmode1.ok \ + charasbytes.awk \ + charasbytes.in \ + charasbytes.ok \ childin.awk \ childin.in \ childin.ok \ @@ -1036,7 +1039,7 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ - backw badargs beginfile1 beginfile2 binmode1 \ + backw badargs beginfile1 beginfile2 binmode1 charasbytes \ clos1way delsub devfd devfd1 devfd2 dumpvars exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ fwtest fwtest2 fwtest3 \ @@ -1836,6 +1839,13 @@ jarebug:: @echo $@ @$(srcdir)/$@.sh "$(AWKPROG)" "$(srcdir)/$@.awk" "$(srcdir)/$@.in" "_$@" @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +charasbytes: + @echo $@ + @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ + AWKPATH=$(srcdir) $(AWK) -b -f $@.awk $(srcdir)/$@.in | \ + od -c -t x1 >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: |