+/* Dump the string from FINPUT to FOUTPUT. MATCH is the delimiter of
+ the string (either ' or "). */
+
+void
+copy_string (FILE *finput, FILE *foutput, int match)
+{
+ int c;
+
+ putc (match, foutput);
+ c = getc (finput);
+
+ while (c != match)
+ {
+ if (c == EOF)
+ fatal(_("unterminated string at end of file"));
+ if (c == '\n')
+ {
+ warn (_("unterminated string"));
+ ungetc (c, finput);
+ c = match; /* invent terminator */
+ continue;
+ }
+
+ putc(c, foutput);
+
+ if (c == '\\')
+ {
+ c = getc (finput);
+ if (c == EOF)
+ fatal (_("unterminated string"));
+ putc (c, foutput);
+ if (c == '\n')
+ lineno++;
+ }
+
+ c = getc(finput);
+ }
+
+ putc(c, foutput);
+}
+