Updated for correclty identify i(xxx) vector names in rawfiles.

This commit is contained in:
pnenzi 2008-11-20 10:47:23 +00:00
parent 93fee0a665
commit 3a053d09cc
2 changed files with 40 additions and 8 deletions

View File

@ -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

View File

@ -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]);