Always set SVNVERSION to "exported" if it otherwise fails.

This commit is contained in:
Martin v. Löwis 2006-01-05 10:33:59 +00:00
parent dea59e5755
commit c5bf5a00a3
4 changed files with 25 additions and 17 deletions

View file

@ -28,15 +28,17 @@ Py_GetBuildInfo(void)
{
static char buildinfo[50];
#ifdef SVNVERSION
static char svnversion[] = SVNVERSION;
static char svnversion[50] = SVNVERSION;
#else
static char svnversion[20] = "unknown";
if (strstr(headurl, "/tags/") != NULL) {
int start = ;
static char svnversion[50] = "exported";
#endif
if (strcmp(svnversion, "exported") == 0 &&
strstr(headurl, "/tags/") != NULL) {
int start = 11;
int stop = strlen(revision)-2;
strncpy(svnversion, revision+start, stop-start);
svnversion[stop-start] = '\0';
}
#endif
PyOS_snprintf(buildinfo, sizeof(buildinfo),
"%s, %.20s, %.9s", svnversion, DATE, TIME);
return buildinfo;