Parcourir la source

Remove any non-alpha chars from the filename.

bugz il y a 4 ans
Parent
commit
24672a897b
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      ansi-to-src.cpp

+ 6 - 0
ansi-to-src.cpp

@@ -99,6 +99,12 @@ int read_file(const char *filename) {
   if ((cp = strchr(buffer, '.')) != NULL) {
     *cp = 0;
   }
+  cp = buffer;
+  while (*cp != 0) {
+    if (! isalpha(*cp)) 
+      memmove(cp, cp+1, strlen(cp));
+    cp++;
+  }
   printf( "const char * %s[] = {\n", buffer);