| 37 | } |
| 38 | |
| 39 | static char * |
| 40 | unescape_inline (char *escaped) |
| 41 | { |
| 42 | char *unescaped, *res; |
| 43 | const char *end; |
| 44 | |
| 45 | res = escaped; |
| 46 | end = escaped + strlen (escaped); |
| 47 | |
| 48 | unescaped = escaped; |
| 49 | while (escaped < end) |
| 50 | { |
| 51 | if (*escaped == '\\') |
| 52 | { |
| 53 | *unescaped++ = |
| 54 | ((escaped[1] - '0') << 6) | |
| 55 | ((escaped[2] - '0') << 3) | |
| 56 | ((escaped[3] - '0') << 0); |
| 57 | escaped += 4; |
| 58 | } |
| 59 | else |
| 60 | { |
| 61 | *unescaped++ = *escaped++; |
| 62 | } |
| 63 | } |
| 64 | *unescaped = 0; |
| 65 | return res; |
| 66 | } |
| 67 | |
| 68 | static bool |
| 69 | match_token (const char *token, const char *token_end, const char *str) |