s = fopen(sourcefile, "r"); if (!s)
{
fprintf(stderr, "Could not open file %s for reading\n", sourcefile); exit(2);
}
t = fopen(outfile, "w"); if (!t)
{
fprintf(stderr, "Could not open file %s for writing\n", outfile); exit(2);
}
initStringInfo(&linebuf);
while (pg_get_line_buf(s, &linebuf))
{ /* check for "#line " in the beginning */ if (strstr(linebuf.data, "#line ") == linebuf.data)
{ char *p = strchr(linebuf.data, '"'); int plen = 1;
while (*p && (*(p + plen) == '.' || strchr(p + plen, '/') != NULL))
{
plen++;
} /* plen is one more than the number of . and / characters */ if (plen > 1)
{
memmove(p + 1, p + plen, strlen(p + plen) + 1); /* we don't bother to fix up linebuf.len */
}
}
fputs(linebuf.data, t);
}
s = fopen(resultfile, "r"); if (!s)
{
fprintf(stderr, "Could not open file %s for reading\n", resultfile); exit(2);
}
t = fopen(tmpfile, "w"); if (!t)
{
fprintf(stderr, "Could not open file %s for writing\n", tmpfile); exit(2);
}
initStringInfo(&linebuf);
while (pg_get_line_buf(s, &linebuf))
{ char *p1 = strstr(linebuf.data, "connection to server ");
if (p1)
{ char *p2 = strstr(p1, "failed: ");
if (p2)
{
memmove(p1 + 21, p2, strlen(p2) + 1); /* we don't bother to fix up linebuf.len */
}
}
fputs(linebuf.data, t);
}
pfree(linebuf.data);
fclose(s);
fclose(t); if (rename(tmpfile, resultfile) != 0)
{
fprintf(stderr, "Could not overwrite file %s with %s\n",
resultfile, tmpfile); exit(2);
}
}
/* make a version of the test name that has dashes in place of slashes */
initStringInfo(&testname_dash);
appendStringInfoString(&testname_dash, testname); for (char *c = testname_dash.data; *c != '\0'; c++)
{ if (*c == '/')
*c = '-';
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.