From adb7f7bca71b0c17c796bd8983cb8f00b3ded85d Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Tue, 30 Sep 1997 20:06:15 +0000 Subject: [PATCH] Fix the broken `date HHMM.SS' handling. PR: bin/4661 Submitted by: blank@sliphost37.uni-trier.de (Sascha Blank) --- bin/date/date.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/date/date.c b/bin/date/date.c index 14b2b671b9cd..73a379064d1d 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: date.c,v 1.16 1997/08/10 16:36:59 brian Exp $ + * $Id: date.c,v 1.17 1997/08/10 16:37:33 brian Exp $ */ #ifndef lint @@ -213,7 +213,8 @@ setthetime(fmt, p) } else lt->tm_sec = 0; - switch (strlen(p)) { + /* if p has a ".ss" field then let's pretend it's not there */ + switch (strlen(p) - ((dot != NULL) ? 3 : 0)) { case 10: /* yy */ lt->tm_year = ATOI2(p); if (lt->tm_year < 69) /* hack for 2000 ;-} */