View | Details | Raw Unified | Return to bug 180957
Collapse All | Expand All

(-)xcdroast-0.98+0alpha16/src/io.c (-4 / +11 lines)
Lines 10062-10067 Link Here
10062
10062
10063
gint check_version_cdda2wav(gchar *match, gchar *found) {
10063
gint check_version_cdda2wav(gchar *match, gchar *found) {
10064
gchar line[MAXLINE];
10064
gchar line[MAXLINE];
10065
gchar vline[MAXLINE];
10065
gchar ver[MAXLINE];
10066
gchar ver[MAXLINE];
10066
FILE *fpin;
10067
FILE *fpin;
10067
gchar *p;
10068
gchar *p;
Lines 10076-10107 Link Here
10076
        }
10077
        }
10077
10078
10078
	strcpy(line,"");
10079
	strcpy(line,"");
10080
	strcpy(vline,"");
10079
        for (;;) {
10081
        for (;;) {
10080
                if (fgets(line,MAXLINE,fpin) == NULL) 
10082
                if (fgets(line,MAXLINE,fpin) == NULL) 
10081
                        break;
10083
                        break;
10082
		dodebug(10,"got: %s",line);
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
        if (pclose(fpin) == -1) {
10092
        if (pclose(fpin) == -1) {
10086
                g_error("pclose error\n");
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
		/* failed to open - permission denied */
10097
		/* failed to open - permission denied */
10091
		return 2;
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
	/* try to extract the version number */
10102
	/* try to extract the version number */
10096
10103
10097
	p = strstr(line,"version");
10104
	p = strstr(vline,"version");
10098
	if (p != NULL) {
10105
	if (p != NULL) {
10099
		p = strtok(p+8, " _");
10106
		p = strtok(p+8, " _");
10100
		if (p != NULL) {
10107
		if (p != NULL) {
10101
			strcpy(ver,p);
10108
			strcpy(ver,p);
10102
		}
10109
		}
10103
	} else {
10110
	} else {
10104
		p = strstr(line,"cdda2wav");
10111
		p = strstr(vline,"cdda2wav");
10105
		if (p != NULL) {
10112
		if (p != NULL) {
10106
			p = strtok(p+9, " ");
10113
			p = strtok(p+9, " ");
10107
			if (p != NULL) {
10114
			if (p != NULL) {

Return to bug 180957