+/* Returns a malloc()'d copy of INPUT with \ooo octal escapes replaced by their
+ values. */
+static char *
+backslash_decode (const char *input)
+{
+ char *output = xmalloc (strlen (input) + 1);
+ char *p = output;
+ for (; *input; input++)
+ {
+ if (*input == '\\' && input[1] >= '0' && input[1] <= '7')
+ {
+ uint8_t c = 0;
+ while (input[1] >= '0' && input[1] <= '7')
+ c = c * 8 + (*++input - '0');
+ *p++ = c;
+ }
+ else
+ *p++ = *input;
+ }
+ *p = '\0';
+
+ return output;
+}
+