diff options
Diffstat (limited to 'src/LYShowInfo.c')
-rw-r--r-- | src/LYShowInfo.c | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/src/LYShowInfo.c b/src/LYShowInfo.c index f465cfd7..7d176754 100644 --- a/src/LYShowInfo.c +++ b/src/LYShowInfo.c @@ -12,6 +12,7 @@ #include <GridText.h> #include <LYReadCFG.h> #include <LYCharSets.h> +#include <LYStrings.h> #include <LYLeaks.h> @@ -24,6 +25,37 @@ #define ADVANCED_INFO 1 /* to get more info in advanced mode */ /* + * LYNX_VERSION and LYNX_DATE are automatically generated by PRCS, the tool + * which we use to archive versions of Lynx. We use a convention for naming + * the successive versions: + * {release}{status}{patch} + * where + * {release} is the release that we are working on, e.g., 2.8.3 + * {status} is one of "dev", "pre" or "rel", and + * {patch} is a number assigned by PRCS. + */ +PUBLIC BOOL LYVersionIsRelease NOARGS +{ + return strstr(LYNX_VERSION, "rel") != 0; +} + +PUBLIC char *LYVersionStatus NOARGS +{ + if (LYVersionIsRelease()) + return REL_VERSION; + else if (strstr(LYNX_VERSION, "pre") != 0) + return PRE_VERSION; + return DEV_VERSION; +} + +PUBLIC char *LYVersionDate NOARGS +{ + static char temp[LYNX_DATE_LEN+1]; + LYstrncpy(temp, &LYNX_DATE[LYNX_DATE_OFF], LYNX_DATE_LEN); + return temp; +} + +/* * Showinfo prints a page of info about the current file and the link * that the cursor is on. */ @@ -80,12 +112,11 @@ PUBLIC int showinfo ARGS4( fprintf(fp0, "<title>%s</title>\n</head>\n<body>\n", SHOWINFO_TITLE); - fprintf(fp0, "<h1>%s %s (%.*s) (<a href=\"%s\">%s</a>)", + fprintf(fp0, "<h1>%s %s (%s) (<a href=\"%s\">%s</a>)", LYNX_NAME, LYNX_VERSION, - LYNX_DATE_LEN, - (LYNX_RELEASE ? LYNX_RELEASE_DATE : &LYNX_DATE[LYNX_DATE_OFF]), - (LYNX_RELEASE ? LYNX_WWW_HOME : LYNX_WWW_DIST), - (LYNX_RELEASE ? REL_VERSION : DEV_VERSION) ); + LYVersionDate(), + (LYVersionIsRelease() ? LYNX_WWW_HOME : LYNX_WWW_DIST), + LYVersionStatus()); fprintf(fp0, "</h1>\n"); /* don't forget to close <h1> */ |