From fcbf63e62c627deae76c1b8cb8c0876c536ed811 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Mon, 16 Mar 2020 18:49:26 +0900 Subject: Fresh start --- jni/iconv/po/insert-header.sin | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 jni/iconv/po/insert-header.sin (limited to 'jni/iconv/po/insert-header.sin') diff --git a/jni/iconv/po/insert-header.sin b/jni/iconv/po/insert-header.sin new file mode 100644 index 0000000..b26de01 --- /dev/null +++ b/jni/iconv/po/insert-header.sin @@ -0,0 +1,23 @@ +# Sed script that inserts the file called HEADER before the header entry. +# +# At each occurrence of a line starting with "msgid ", we execute the following +# commands. At the first occurrence, insert the file. At the following +# occurrences, do nothing. The distinction between the first and the following +# occurrences is achieved by looking at the hold space. +/^msgid /{ +x +# Test if the hold space is empty. +s/m/m/ +ta +# Yes it was empty. First occurrence. Read the file. +r HEADER +# Output the file's contents by reading the next line. But don't lose the +# current line while doing this. +g +N +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} -- cgit v1.2.3