Skip to contentSkip to conversation

po: fix replacement of %m in sed programs

PATCH In review Mike Gilbert 2 participants 2 messages Mar 2, 2020 – Mar 3, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 po: fix replacement of %m in sed programs

When running make dist, I hit this error:

rm -f [email protected] && /usr/bin/gmsgfmt -c --statistics --verbose -o [email protected] [email protected] [email protected]:5312: 'msgstr' is not a valid C format string, unlike 'msgid'.
Reason: The character that terminates the directive number 3 is not a valid conversion specifier. /usr/bin/gmsgfmt: found 1 fatal error

This was caused by "%m" being replaced with foreign Unicode characters. For example:

msgid "cannot rename the file %s to %s: %m"
msgstr "ﺹﺎﻨﻧﻮﺗ ﺮﻌﻧﺎﻤﻋ ﺖﻬﻋ ﻒִﻴﻠﻋ %s ﺕﻭ %s: %ﻡ"

Mimic the workaround used for "%s" by reversing the replacement of "%m" at the end of the sed programs.

---
 po/arabic.sed   | 1 +
 po/cyrillic.sed | 1 +
 po/greek.sed    | 1 +
 po/hebrew.sed   | 1 +
 4 files changed, 4 insertions(+)
po/arabic.sed +1 -0
index b5b5db661..21dc8b6db 100644
@@ -73,6 +73,7 @@ s,%\([0-9]*\)لد,%\1ld,g
 s,%\([0-9]*\)للد,%\1lld,g
 
 s,%\([0-9\.\*]*\)س,%\1s,g
+s,%\([0-9\.\*]*\)م,%\1m,g
 s,%\([0-9]*\)لو,%\1lu,g
 s,%\([0-9]*\)و,%\1u,g
 s,%\([0-9]*\)للو,%\1llu,g
po/cyrillic.sed +1 -0
index ffad0ed8c..2e3e6655d 100644
@@ -96,6 +96,7 @@ s,%\([0-9]*\)лд,%\1ld,g
 s,%\([0-9]*\)ллд,%\1lld,g
 
 s,%\([0-9\.\*]*\)с,%\1s,g
+s,%\([0-9\.\*]*\)м,%\1m,g
 s,%\([0-9]*\)лу,%\1lu,g
 s,%\([0-9]*\)у,%\1u,g
 s,%\([0-9]*\)ллу,%\1llu,g
po/greek.sed +1 -0
index 93556c386..3543f6aac 100644
@@ -98,6 +98,7 @@ s,%\([0-9]*\)λδ,%\1ld,g
 s,%\([0-9]*\)λλδ,%\1lld,g
 
 s,%\([0-9\.\*]*\)σ,%\1s,g
+s,%\([0-9\.\*]*\)μ,%\1m,g
 s,%\([0-9]*\)λυ,%\1lu,g
 s,%\([0-9]*\)υ,%\1u,g
 s,%\([0-9]*\)λλυ,%\1llu,g
po/hebrew.sed +1 -0
index a47bc6a28..9210014bc 100644
@@ -81,6 +81,7 @@ s,%\([0-9]*\)לד,%\1ld,g
 s,%\([0-9]*\)ללד,%\1lld,g
 
 s,%\([0-9\.\*]*\)ש,%\1s,g
+s,%\([0-9\.\*]*\)מ,%\1m,g
 s,%\([0-9]*\)לוּ,%\1lu,g
 s,%\([0-9]*\)וּ,%\1u,g
 s,%\([0-9]*\)ללוּ,%\1llu,g
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Mike Gilbert

When running make dist, I hit this error:

rm -f [email protected] && /usr/bin/gmsgfmt -c --statistics --verbose -o [email protected] [email protected] [email protected]:5312: 'msgstr' is not a valid C format string, unlike 'msgid'.
Reason: The character that terminates the directive number 3 is not a valid conversion specifier. /usr/bin/gmsgfmt: found 1 fatal error

This was caused by "%m" being replaced with foreign Unicode characters. For example:

Quoted 7 lines

msgid "cannot rename the file %s to %s: %m"
msgstr "ﺹﺎﻨﻧﻮﺗ ﺮﻌﻧﺎﻤﻋ ﺖﻬﻋ ﻒִﻴﻠﻋ %s ﺕﻭ %s: %ﻡ"

Mimic the workaround used for "%s" by reversing the replacement of "%m" at the end of the sed programs.

Daniel