comparison pads2gpcb/decals.c @ 49:b3b7013d9228

pads2gpcb.c/decals.c: allow underscores in written decal file names
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Sat, 30 Jan 2016 17:38:47 +0000
parents c977d637f038
children 727d4e56d5c8
comparison
equal deleted inserted replaced
48:c977d637f038 49:b3b7013d9228
268 } 268 }
269 strcpy(filename, "decals/"); 269 strcpy(filename, "decals/");
270 dp = filename + 7; 270 dp = filename + 7;
271 for (cp = current_decal->name; *cp; ) { 271 for (cp = current_decal->name; *cp; ) {
272 c = *cp++; 272 c = *cp++;
273 if (isalnum(c) || c == '-' || c == '.') 273 if (isalnum(c) || c == '-' || c == '.' || c == '_')
274 *dp++ = c; 274 *dp++ = c;
275 else { 275 else {
276 sprintf(dp, "%%%02X", c); 276 sprintf(dp, "%%%02X", c);
277 dp += 3; 277 dp += 3;
278 } 278 }
283 perror(filename); 283 perror(filename);
284 exit(1); 284 exit(1);
285 } 285 }
286 write_gpcb_element(outf, current_decal->body, 0, "", "", "", 0); 286 write_gpcb_element(outf, current_decal->body, 0, "", "", "", 0);
287 fclose(outf); 287 fclose(outf);
288 printf("Written to %s\n", filename);
288 free(filename); 289 free(filename);
289 } 290 }
290 291
291 static void 292 static void
292 process_one_decal() 293 process_one_decal()