diff -urNad xcdroast-0.98+0alpha16~/src/io.c xcdroast-0.98+0alpha16/src/io.c
|
|
|
10062 | 10062 | |
10063 | 10063 | gint check_version_cdda2wav(gchar *match, gchar *found) { |
10064 | 10064 | gchar line[MAXLINE]; |
| 10065 | gchar vline[MAXLINE]; |
10065 | 10066 | gchar ver[MAXLINE]; |
10066 | 10067 | FILE *fpin; |
10067 | 10068 | gchar *p; |
… |
… |
|
10076 | 10077 | } |
10077 | 10078 | |
10078 | 10079 | strcpy(line,""); |
| 10080 | strcpy(vline,""); |
10079 | 10081 | for (;;) { |
10080 | 10082 | if (fgets(line,MAXLINE,fpin) == NULL) |
10081 | 10083 | break; |
10082 | 10084 | dodebug(10,"got: %s",line); |
| 10085 | |
| 10086 | /* only get first line */ |
| 10087 | if (strcmp(vline,"") == 0) { |
| 10088 | strncpy(vline, line, MAXLINE); |
| 10089 | } |
10083 | 10090 | } |
10084 | 10091 | |
10085 | 10092 | if (pclose(fpin) == -1) { |
10086 | 10093 | g_error("pclose error\n"); |
10087 | 10094 | } |
10088 | 10095 | |
10089 | | if (strcmp(line,"") == 0 || strstr(line,"sh:") != NULL) { |
| 10096 | if (strcmp(vline,"") == 0 || strstr(vline,"sh:") != NULL) { |
10090 | 10097 | /* failed to open - permission denied */ |
10091 | 10098 | return 2; |
10092 | 10099 | } |
10093 | 10100 | |
10094 | | /* now line contains the version string of cdda2wav */ |
| 10101 | /* now vline contains the version string of cdda2wav */ |
10095 | 10102 | /* try to extract the version number */ |
10096 | 10103 | |
10097 | | p = strstr(line,"version"); |
| 10104 | p = strstr(vline,"version"); |
10098 | 10105 | if (p != NULL) { |
10099 | 10106 | p = strtok(p+8, " _"); |
10100 | 10107 | if (p != NULL) { |
10101 | 10108 | strcpy(ver,p); |
10102 | 10109 | } |
10103 | 10110 | } else { |
10104 | | p = strstr(line,"cdda2wav"); |
| 10111 | p = strstr(vline,"cdda2wav"); |
10105 | 10112 | if (p != NULL) { |
10106 | 10113 | p = strtok(p+9, " "); |
10107 | 10114 | if (p != NULL) { |