From f44e4754b76670eab4e29e38da865eac03bcf4fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Andr=C3=A9n=20Zachrisson?= Date: Fri, 30 Oct 2015 22:54:48 +0100 Subject: [PATCH] Add support for both back and forward slashes. Also decrypt the ascii code to actual character --- cue2pops.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cue2pops.c b/cue2pops.c index 2cb121e..386d748 100644 --- a/cue2pops.c +++ b/cue2pops.c @@ -468,14 +468,16 @@ int main(int argc, char **argv) dumpaddr = malloc((strlen(ptr) + strlen(argv[1])) * 2); for(i = strlen(ptr); i > 0; i--) { // Does the cue have the full BINARY path ? - if(ptr[i] == 0x5C) { // YES ! + if((ptr[i] == '\\') || (ptr[i] == '/')) { // YES ! strcpy(dumpaddr, ptr); break; } } if(i == 0) { // If no.. for(i = strlen(argv[1]); i > 0; i--) { // Does the arg have the full cue path ? - if(argv[1][i] == 0x5C) break;// YES ! + if((argv[1][i] == '\\') || (argv[1][i] == '/')) { + break; // YES ! + } } if(i == 0) { // No path in argv[1] + No path in the cuesheet ? Then it's FUQD :( . printf("Error: Cannot find %s that is linked to the cue sheet\n\n", ptr); @@ -486,7 +488,8 @@ int main(int argc, char **argv) strcpy(dumpaddr, argv[1]); /* Why should I use strrchr when I can do a n00ber thing ;D */ for(i = strlen(dumpaddr); i > 0; i--) { - if(dumpaddr[i] == 0x5C) break; + if((dumpaddr[i] == '\\') || (dumpaddr[i] == '/')) + break; } for(i = i+1; (unsigned long) i < strlen(dumpaddr); i++) dumpaddr[i] = 0x00; // How kewl is dat ? /* Me no liek strncat */