diff --git a/ChangeLog b/ChangeLog index d49827e37..567189c3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-20 Paolo Nenzi + * src/frontend/diff.c: currents in rawfiles are written as i(xxx) and no more as xxx#branch. The diff + interactive command (used to compare plots) did not work anymore. This new version traslates back + i(xxx) to xxx#branch. + 2008-11-19 Dietmar Warning * src/frontend/resource.c: found a way to compile w/o psapi under MS VC++ 6.0, prevent some warnings * src/frontend/com_ghelp.c: prevent warnings diff --git a/src/frontend/diff.c b/src/frontend/diff.c index 1109ede24..8cc6bf8fa 100644 --- a/src/frontend/diff.c +++ b/src/frontend/diff.c @@ -23,19 +23,46 @@ static bool nameeq(char *n1, char *n2) { char buf1[BSIZE_SP], buf2[BSIZE_SP]; + char *tmp; int i; if (eq(n1, n2)) return (TRUE); - if (isdigit(*n1)) - (void) sprintf(buf1, "v(%s)", n1); - else - (void) strcpy(buf1, n1); - if (isdigit(*n2)) - (void) sprintf(buf2, "v(%s)", n2); - else - (void) strcpy(buf2, n2); + + + /* n1 or n2 is in the form i(...) or I(...) + * This happens in the saved rawfile + */ + + if(ciprefix("i(",n1)) { + tmp = n1; + while ( *tmp != '(' ) tmp++; + tmp++; + (void) strcpy(buf1, tmp); + tmp = buf1; + while ( *tmp != ')' ) tmp++; + *tmp ='\0'; + (void) strcat(buf1, "#branch"); + } else if (isdigit(*n1)) + (void) sprintf(buf1, "v(%s)", n1); + else + (void) strcpy(buf1, n1); + + if(ciprefix("i(",n2)) { + tmp = n2; + while ( *tmp != '(' ) tmp++; + tmp++; + (void) strcpy(buf2, tmp); + tmp = buf2; + while ( *tmp != ')' ) tmp++; + *tmp ='\0'; + (void) strcat(buf2, "#branch"); + } else if (isdigit(*n2)) + (void) sprintf(buf2, "v(%s)", n2); + else + (void) strcpy(buf2, n2); + for (i = 0; buf1[i]; i++) if (isupper(buf1[i])) buf1[i] = tolower(buf1[i]);