23-Mar-2000 09:35 T.E.Dickey wrote:
> (I'm about 80% through the patch).
Please add this one:
* Add Last-Modified header into the printed/downloaded source,
in addition to the Date header (it is there for years).
(Last-Modified field will not be printed if it is vanished from Date
or 1 Jan 1970... == ctime(0) - common mistake in scripts).
diff -u -r LYNX2-8-.D18/src/htfwrite.c LYNX2-8-/src/htfwrite.c
--- LYNX2-8-.D18/src/htfwrite.c Wed Dec 15 04:03:18 1999
+++ LYNX2-8-/src/htfwrite.c Sun Mar 12 22:38:14 2000
@@ -875,9 +875,16 @@
fprintf(ret_obj->fp,
"<!-- X-URL: %s -->\n", anchor->address);
- if (anchor->date && *anchor->date)
+ if (anchor->date && *anchor->date) {
fprintf(ret_obj->fp,
"<!-- Date: %s -->\n", anchor->date);
+ if (anchor->last_modified && *anchor->last_modified
+ && !strcmp(anchor->last_modified, anchor->date)
+ && !strcmp(anchor->last_modified, ctime((time_t)0))) {
+ fprintf(ret_obj->fp,
+ "<!-- Last-Modified: %s -->\n", anchor->last_modified);
+ }
+ }
fprintf(ret_obj->fp,
"<BASE HREF=\"%s\">\n\n", (temp ? temp : anchor->address));
FREE(temp);
diff -u -r LYNX2-8-.D18/src/lyprint.c LYNX2-8-/src/lyprint.c
--- LYNX2-8-.D18/src/lyprint.c Wed Dec 15 15:26:06 1999
+++ LYNX2-8-/src/lyprint.c Sat Mar 25 16:03:22 2000
@@ -406,9 +406,17 @@
fprintf(outfile_fp,
"<!-- X-URL: %s -->\n", newdoc->address);
- if (HText_getDate() != NULL)
+ if (HText_getDate() != NULL) {
fprintf(outfile_fp,
"<!-- Date: %s -->\n", HText_getDate());
+ if (HText_getLastModified() != NULL
+ && !strcmp(HText_getLastModified(), HText_getDate())
+ && !strcmp(HText_getLastModified(), ctime((time_t)0))) {
+ fprintf(outfile_fp,
+ "<!-- Last-Modified: %s -->\n", HText_getLastModified());
+ }
+ }
+
fprintf(outfile_fp,
"<BASE HREF=\"%s\">\n", content_base);
}