diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/LYMain.c | 7 | ||||
-rw-r--r-- | src/LYShowInfo.c | 41 | ||||
-rw-r--r-- | src/LYShowInfo.h | 3 |
3 files changed, 42 insertions, 9 deletions
diff --git a/src/LYMain.c b/src/LYMain.c index c51b31c2..8bcb1f19 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -29,6 +29,7 @@ #include <LYBookmark.h> #include <LYCookie.h> #include <LYPrettySrc.h> +#include <LYShowInfo.h> #ifdef VMS #include <HTFTP.h> @@ -3028,11 +3029,9 @@ static int version_fun ARGS1( SetOutputMode( O_TEXT ); printf("\n"); - printf(gettext("\n%s Version %s (%.*s)\n"), + printf(gettext("\n%s Version %s (%s)\n"), LYNX_NAME, LYNX_VERSION, - LYNX_DATE_LEN, - LYNX_RELEASE ? LYNX_RELEASE_DATE : &LYNX_DATE[LYNX_DATE_OFF] - ); + LYVersionDate()); #ifdef SYSTEM_NAME #ifndef __DATE__ #define __DATE__ "" 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> */ diff --git a/src/LYShowInfo.h b/src/LYShowInfo.h index 65eb88e5..038492a9 100644 --- a/src/LYShowInfo.h +++ b/src/LYShowInfo.h @@ -5,6 +5,9 @@ #include <LYStructs.h> #endif /* LYSTRUCTS_H */ +extern BOOL LYVersionIsRelease NOPARAMS; +extern char *LYVersionStatus NOPARAMS; +extern char *LYVersionDate NOPARAMS; extern int showinfo PARAMS((document *doc, int size_of_file, document *newdoc, char *owner_address)); |