+static char *strdup_decoding_octal(const char *string) {
+ char *buffer = strdup(string);
+ if(!buffer) fatal("Cannot allocate memory.");
+
+ char *d = buffer;
+ const char *s = string;
+
+ while(*s) {
+ if(unlikely(*s == '\\')) {
+ if(likely(isdigit(s[1]) && isdigit(s[2]) && isdigit(s[3]))) {
+ char c = *s++ - '0';
+ c <<= 3;
+ c |= *s++ - '0';
+ c <<= 3;
+ c |= *s++ - '0';
+ *d++ = c;
+ }
+ else {
+ *d++ = '_';
+ s++;
+ }
+ }
+ else *d++ = *s++;
+ }
+ *d = '\0';
+
+ return buffer;
+}
+