bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] date -d lunchtime


From: James Youngman
Subject: [patch] date -d lunchtime
Date: Sat, 16 Jul 2005 23:14:48 +0100
User-agent: Mutt/1.5.9i

Printing to stderr may not be the best thing for a library function to
do, so I'm not sure if this patch is factored correctly.  The yylex()
function isn't really able to return an error message as such.
Anyway, here's my patch (against current CVS).


2005-07-16  James Youngman  <address@hidden>

        * lib/getdate.y (yylex): Added spurious Douglas Adams quotation.

Index: getdate.y
===================================================================
RCS file: /cvsroot/coreutils/coreutils/lib/getdate.y,v
retrieving revision 1.99
diff -u -r1.99 getdate.y
--- getdate.y   14 May 2005 07:58:06 -0000      1.99
+++ getdate.y   16 Jul 2005 22:00:40 -0000
@@ -1057,7 +1057,14 @@
          *p = '\0';
          tp = lookup_word (pc, buff);
          if (! tp)
-           return '?';
+           {
+             if (0 == strcasecmp(buff, "LUNCHTIME"))
+               {
+                 fprintf(stderr,
+                         "Time is an illusion, lunchtime doubly so.\n\t-- 
Douglas Adams\n");
+               }
+             return '?';
+           }
          lvalp->intval = tp->value;
          return tp->type;
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]