aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-10-04 23:29:29 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-10-04 23:29:29 +0300
commit42bcb6246432790af31958d5445cd035fe9966a5 (patch)
tree0e458b6c48556a1b86a0374c9bf900fdb31718c1
parentc7a0e4b598a39084c288f975a59549b6068051cf (diff)
downloadegawk-42bcb6246432790af31958d5445cd035fe9966a5.tar.gz
egawk-42bcb6246432790af31958d5445cd035fe9966a5.tar.bz2
egawk-42bcb6246432790af31958d5445cd035fe9966a5.zip
Fix --gen-pot with long strings.
-rw-r--r--ChangeLog6
-rw-r--r--profile.c4
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am9
-rw-r--r--test/Makefile.in9
-rw-r--r--test/genpot.awk1
-rw-r--r--test/genpot.ok5
7 files changed, 35 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b0f9a6f..72a27d76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-10-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile.c (pp_string_fp): Fix breaklines case to actually
+ output the current letter. This broke at gawk 4.0.0. Sigh.
+ Thanks to Bert Bos (bert@w3.org) for the report.
+
2014-09-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
* main.c (main): In optlist, it should say "h", not "h:", since there
diff --git a/profile.c b/profile.c
index b0fbbedb..84e7f9da 100644
--- a/profile.c
+++ b/profile.c
@@ -909,11 +909,11 @@ pp_string_fp(Func_print print_func, FILE *fp, const char *in_str,
slen = strlen(str);
for (count = 0; slen > 0; slen--, str++) {
+ print_func(fp, "%c", *str);
if (++count >= BREAKPOINT && breaklines) {
print_func(fp, "%c\n%c", delim, delim);
count = 0;
- } else
- print_func(fp, "%c", *str);
+ }
}
efree(s);
}
diff --git a/test/ChangeLog b/test/ChangeLog
index a8a2acdc..caee294f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2014-10-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (genpot): New test.
+ * genpot.awk, genpot.ok: New files.
+
2014-09-29 Arnold D. Robbins <arnold@skeeve.com>
* testext.ok: Adjusted after minor code change.
diff --git a/test/Makefile.am b/test/Makefile.am
index ad7e13af..1e81d2ac 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -324,6 +324,8 @@ EXTRA_DIST = \
fwtest3.awk \
fwtest3.in \
fwtest3.ok \
+ genpot.awk \
+ genpot.ok \
gensub.awk \
gensub.in \
gensub.ok \
@@ -1007,7 +1009,7 @@ GAWK_EXT_TESTS = \
colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \
fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \
functab1 functab2 functab3 fwtest fwtest2 fwtest3 \
- gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
+ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
icasefs icasers id igncdym igncfs ignrcas2 ignrcase \
incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \
include include2 indirectcall indirectcall2 \
@@ -1968,6 +1970,11 @@ filefuncs:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -v builddir="$(abs_top_builddir)" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+genpot:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --gen-pot >_$@ 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 87fe5c28..47868d7a 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -570,6 +570,8 @@ EXTRA_DIST = \
fwtest3.awk \
fwtest3.in \
fwtest3.ok \
+ genpot.awk \
+ genpot.ok \
gensub.awk \
gensub.in \
gensub.ok \
@@ -1252,7 +1254,7 @@ GAWK_EXT_TESTS = \
colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \
fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \
functab1 functab2 functab3 fwtest fwtest2 fwtest3 \
- gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
+ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
icasefs icasers id igncdym igncfs ignrcas2 ignrcase \
incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \
include include2 indirectcall indirectcall2 \
@@ -2391,6 +2393,11 @@ filefuncs:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -v builddir="$(abs_top_builddir)" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+genpot:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --gen-pot >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/genpot.awk b/test/genpot.awk
new file mode 100644
index 00000000..990b0b5c
--- /dev/null
+++ b/test/genpot.awk
@@ -0,0 +1 @@
+{print _"This string is so long that gawk --gen-pot will break it and lose a letter at the break."}
diff --git a/test/genpot.ok b/test/genpot.ok
new file mode 100644
index 00000000..35c0cc99
--- /dev/null
+++ b/test/genpot.ok
@@ -0,0 +1,5 @@
+#: genpot.awk:1
+msgid "This string is so long that gawk --gen-pot will break it and lose a l"
+"etter at the break."
+msgstr ""
+