Ticket #46840: cdda2wav_version.patch

File cdda2wav_version.patch, 1.4 KB (added by RJVB (René Bertin), 9 years ago)
  • src/io.c

    diff -urNad xcdroast-0.98+0alpha16~/src/io.c xcdroast-0.98+0alpha16/src/io.c
     
    1006210062
    1006310063gint check_version_cdda2wav(gchar *match, gchar *found) {
    1006410064gchar line[MAXLINE];
     10065gchar vline[MAXLINE];
    1006510066gchar ver[MAXLINE];
    1006610067FILE *fpin;
    1006710068gchar *p;
     
    1007610077        }
    1007710078
    1007810079        strcpy(line,"");
     10080        strcpy(vline,"");
    1007910081        for (;;) {
    1008010082                if (fgets(line,MAXLINE,fpin) == NULL)
    1008110083                        break;
    1008210084                dodebug(10,"got: %s",line);
     10085
     10086                /* only get first line */
     10087                if (strcmp(vline,"") == 0) {
     10088                        strncpy(vline, line, MAXLINE);
     10089                }
    1008310090        }
    1008410091
    1008510092        if (pclose(fpin) == -1) {
    1008610093                g_error("pclose error\n");
    1008710094        }
    1008810095
    10089         if (strcmp(line,"") == 0 || strstr(line,"sh:") != NULL) {
     10096        if (strcmp(vline,"") == 0 || strstr(vline,"sh:") != NULL) {
    1009010097                /* failed to open - permission denied */
    1009110098                return 2;
    1009210099        }
    1009310100
    10094         /* now line contains the version string of cdda2wav */
     10101        /* now vline contains the version string of cdda2wav */
    1009510102        /* try to extract the version number */
    1009610103
    10097         p = strstr(line,"version");
     10104        p = strstr(vline,"version");
    1009810105        if (p != NULL) {
    1009910106                p = strtok(p+8, " _");
    1010010107                if (p != NULL) {
    1010110108                        strcpy(ver,p);
    1010210109                }
    1010310110        } else {
    10104                 p = strstr(line,"cdda2wav");
     10111                p = strstr(vline,"cdda2wav");
    1010510112                if (p != NULL) {
    1010610113                        p = strtok(p+9, " ");
    1010710114                        if (p != NULL) {