Mercurial > emacs
comparison src/strftime.c @ 23323:0800a4f84757
(underlying_strftime):
Set the buffer to a nonzero value before calling
strftime, and check to see whether strftime has set the buffer to zero.
This lets us distinguish between an empty buffer and an error.
I'm installing this patch by hand now; it will be superseded whenever
the glibc sources are propagated back to fsf.org.
author | Paul Eggert <eggert@twinsun.com> |
---|---|
date | Fri, 25 Sep 1998 21:40:23 +0000 |
parents | 1a370f7cc0c1 |
children | b7aa6ac26872 |
comparison
equal
deleted
inserted
replaced
23322:26cc35857be5 | 23323:0800a4f84757 |
---|---|
740 *u++ = '%'; | 740 *u++ = '%'; |
741 if (modifier != 0) | 741 if (modifier != 0) |
742 *u++ = modifier; | 742 *u++ = modifier; |
743 *u++ = format_char; | 743 *u++ = format_char; |
744 *u = '\0'; | 744 *u = '\0'; |
745 ubuf[0] = '\1'; | |
745 len = strftime (ubuf, sizeof ubuf, ufmt, tp); | 746 len = strftime (ubuf, sizeof ubuf, ufmt, tp); |
746 if (len == 0) | 747 if (len == 0 && ubuf[0] != '\0') |
747 return 0; | 748 return 0; |
748 cpy (len, ubuf); | 749 cpy (len, ubuf); |
749 } | 750 } |
750 break; | 751 break; |
751 #endif | 752 #endif |