shithub: rssfill

Download patch

ref: cab76c1c0f359ecaaa7c37f84d70c546fbf7a37e
parent: ad5019c396ab474093dd40c8e880125eb12e9864
author: sirjofri <sirjofri@sirjofri.de>
date: Mon Apr 19 05:35:45 EDT 2021

uses new libdate (in 9front)

--- a/mkfile
+++ b/mkfile
@@ -2,7 +2,7 @@
 
 BIN=$home/bin/$objtype
 TARG=rssfill
-OFILES=rssfill.$O date.$O
-HFILES=rssfill.h xmlpull.h date.h
+OFILES=rssfill.$O
+HFILES=rssfill.h xmlpull.h
 
 </sys/src/cmd/mkone
--- a/rssfill.c
+++ b/rssfill.c
@@ -3,7 +3,7 @@
 #include <bio.h>
 #include "xmlpull.h"
 #include "rssfill.h"
-#include "date.h"
+//#include "date.h"
 
 char  *directory = "/lib/news";
 char  *prefix = "";
@@ -36,14 +36,14 @@
 
 		while(f != nil){
 			if(f->s == 2){
-				if(tmparse(&t, "W[,] ?D MMM YYYY hh:mm:ss ?Z", f->date, nil) == nil)
-					if(tmparse(&t, "YYYY-MM-DD[T]hh:mm:ss?Z", f->date, nil) == nil)
-						if(tmparse(&t, nil, f->date, nil) == nil)
+				if(tmparse(&t, "W[,] ?D MMM YYYY hh:mm:ss ?Z", f->date, nil, nil) == nil)
+					if(tmparse(&t, "YYYY-MM-DD[T]hh:mm:ss?Z", f->date, nil, nil) == nil)
+						if(tmparse(&t, nil, f->date, nil, nil) == nil)
 							sysfatal("tmparse: %r");
 						else
 							fprint(2, "tmparse: auto parsed date\n");
 				
-				d = t.abs;
+				d = tmnorm(&t);
 				
 				snprint(file, 1023, "%s/%s%ld", directory, prefix, d);