--- prc-tools-0.5.0r.orig/build-prc.c +++ prc-tools-0.5.0r/build-prc.c @@ -64,10 +64,19 @@ /* the .prc write routines write the resources in reverse order! */ for (i=argc-1; i > optind + 2; i--) { + char *rname; if ((fd = open(argv[i], O_PLATFORM | O_RDONLY)) < 1) { fprintf(stderr, "Can't open resource file %s\n",argv[i]); exit(3); } + + rname = strchr(argv[i], '/'); + if (!rname) rname = argv[i]; + else rname++; /* skip over the / */ + if (strlen(rname) <= 4) { + fprintf(stderr, "%s not in proper [name][id] form\n", argv[i]); + exit(4); + } slen = lseek(fd, 0, SEEK_END); lseek(fd, 0, SEEK_SET); @@ -76,7 +85,7 @@ read(fd, sd, slen); close (fd); - add_section_pfd(pf, argv[i], strtoul(argv[i] + 4, (void *)0, 16), + add_section_pfd(pf, rname, strtoul(rname + 4, (void *)0, 16), sd, slen); }