Browse Source

xlate: more sed escaping

vampirefrog 2 weeks ago
parent
commit
cad555cc09
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      xlate.c

+ 2
- 1
xlate.c View File

@@ -21,7 +21,8 @@ int main(int argc, char **argv) {
21 21
 		}
22 22
 		printf("/");
23 23
 		for(unsigned char *c = to; *c; c++) {
24
-			if(*c == '/') printf("\\%c", *c);
24
+			if(strchr("/", *c)) printf("\\%c", *c);
25
+			else if(strchr("'", *c)) printf("',$%02x,'", *c);
25 26
 			else printf("%c", *c);
26 27
 		}
27 28
 		printf("/g\n");

Loading…
Cancel
Save