diff options
author | joerg <joerg@FreeBSD.org> | 1997-09-30 20:06:15 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1997-09-30 20:06:15 +0000 |
commit | 0f45f2fb69fa51d32a49bcda72f6de056fdf4b0a (patch) | |
tree | 6be244f3e244e37bea6013e965cfbacde7b379d1 /bin/date | |
parent | 1327f7f2c86d9e0482ef936b742982e813383bec (diff) | |
download | FreeBSD-src-0f45f2fb69fa51d32a49bcda72f6de056fdf4b0a.zip FreeBSD-src-0f45f2fb69fa51d32a49bcda72f6de056fdf4b0a.tar.gz |
Fix the broken `date HHMM.SS' handling.
PR: bin/4661
Submitted by: blank@sliphost37.uni-trier.de (Sascha Blank)
Diffstat (limited to 'bin/date')
-rw-r--r-- | bin/date/date.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/date/date.c b/bin/date/date.c index 14b2b67..73a3790 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 ;-} */ |