aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorEli Zaretskii2014-10-14 21:10:37 +0300
committerEli Zaretskii2014-10-14 21:10:37 +0300
commite3060a0c4d2f418ac786775109d71e5843ccf42e (patch)
tree347b37fc39d0db9cd23b3e9f79ee81b4bbc40f08 /lib-src
parent1a3eca0656bdb764200e10a4f264138e94b1f3ce (diff)
parent980d78b3587560c13a46aef352ed8d5ed744acf6 (diff)
downloademacs-e3060a0c4d2f418ac786775109d71e5843ccf42e.tar.gz
emacs-e3060a0c4d2f418ac786775109d71e5843ccf42e.zip
Merge from trunk and resolve conflicts.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog24
-rw-r--r--lib-src/Makefile.in40
-rw-r--r--lib-src/etags.c73
-rw-r--r--lib-src/movemail.c22
4 files changed, 79 insertions, 80 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 199d46f4984..6c31841c130 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,27 @@
12014-09-23 Paul Eggert <eggert@cs.ucla.edu>
2
3 movemail: don't dump core if the current time is outlandish
4 * movemail.c (popmail): Check for mbx_delimit_begin failure.
5 (mbx_delimit_begin): Fail if the current time is so outlandish
6 that localtime would fail or asctime would have undefined
7 behavior. Use strftime to avoid asctime undefined behavior.
8
92014-09-01 Paul Eggert <eggert@cs.ucla.edu>
10
11 --enable-silent-rules now suppresses more chatter.
12 * Makefile.in (AM_DEFAULT_VERBOSITY, AM_V_CC, am__v_CC_)
13 (am__v_CC_0, am__v_CC_1, AM_V_CCLD, am__v_CCLD_, am__v_CCLD_0)
14 (am__v_CCLD_1): New macros, taken from Automake.
15 (regex.o, etags${EXEEXT}, ctags${EXEEXT}, ebrowse${EXEEXT})
16 (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT})
17 (pop.o, emacsclient${EXEEXT}, emacsclientw${EXEEXT})
18 (emacsclientw${EXEEXT}, ntlib.o, hexl${EXEEXT})
19 (update-game-score${EXEEXT}): Use them.
20
21 * etags.c (emacs_strchr, emacs_strrchr): Remove.
22 All uses replaced by strchr and strrchr, which are on all
23 target platforms now.
24
12014-07-15 Paul Eggert <eggert@cs.ucla.edu> 252014-07-15 Paul Eggert <eggert@cs.ucla.edu>
2 26
3 Use "b" flag more consistently; avoid "t" (Bug#18006). 27 Use "b" flag more consistently; avoid "t" (Bug#18006).
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index 7eb13f667ec..fe101047dea 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -45,6 +45,19 @@ UPDATE_MANIFEST = @UPDATE_MANIFEST@
45# Program name transformation. 45# Program name transformation.
46TRANSFORM = @program_transform_name@ 46TRANSFORM = @program_transform_name@
47 47
48# 'make' verbosity.
49AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
50
51AM_V_CC = $(am__v_CC_@AM_V@)
52am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
53am__v_CC_0 = @echo " CC " $@;
54am__v_CC_1 =
55
56AM_V_CCLD = $(am__v_CCLD_@AM_V@)
57am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
58am__v_CCLD_0 = @echo " CCLD " $@;
59am__v_CCLD_1 =
60
48# ==================== Where To Install Things ==================== 61# ==================== Where To Install Things ====================
49 62
50# Location to install Emacs.app under GNUstep / Mac OS X. 63# Location to install Emacs.app under GNUstep / Mac OS X.
@@ -311,7 +324,7 @@ TAGS: etags${EXEEXT}
311 $(MAKE) -C ../lib libgnu.a 324 $(MAKE) -C ../lib libgnu.a
312 325
313regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h) 326regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
314 ${CC} -c ${CPP_CFLAGS} $< 327 $(AM_V_CC)$(CC) -c $(CPP_CFLAGS) $<
315 328
316 329
317etags_deps = ${srcdir}/etags.c regex.o $(NTLIB) $(config_h) 330etags_deps = ${srcdir}/etags.c regex.o $(NTLIB) $(config_h)
@@ -319,41 +332,41 @@ etags_cflags = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" -o $@
319etags_libs = regex.o $(LOADLIBES) $(NTLIB) 332etags_libs = regex.o $(LOADLIBES) $(NTLIB)
320 333
321etags${EXEEXT}: ${etags_deps} 334etags${EXEEXT}: ${etags_deps}
322 $(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs) 335 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs)
323 336
324## ctags.c is distinct from etags.c so that parallel makes do not write two 337## ctags.c is distinct from etags.c so that parallel makes do not write two
325## etags.o files on top of each other. 338## etags.o files on top of each other.
326## FIXME? 339## FIXME?
327## Can't we use a wrapper that calls 'etags --ctags'? 340## Can't we use a wrapper that calls 'etags --ctags'?
328ctags${EXEEXT}: ${srcdir}/ctags.c ${etags_deps} 341ctags${EXEEXT}: ${srcdir}/ctags.c ${etags_deps}
329 $(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs) 342 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs)
330 343
331ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \ 344ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \
332 $(config_h) 345 $(config_h)
333 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ 346 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
334 $< $(LOADLIBES) $(NTLIB) -o $@ 347 $< $(LOADLIBES) $(NTLIB) -o $@
335 348
336profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h) 349profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h)
337 $(CC) ${ALL_CFLAGS} $< \ 350 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< \
338 $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o $@ 351 $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o $@
339 352
340make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h) 353make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h)
341 $(CC) ${ALL_CFLAGS} $< $(LOADLIBES) $(NTLIB) -o $@ 354 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(LOADLIBES) $(NTLIB) -o $@
342 355
343movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h) 356movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h)
344 $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} $< pop.o \ 357 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} $< pop.o \
345 $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o $@ 358 $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o $@
346 359
347pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h) 360pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h)
348 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} $< 361 $(AM_V_CC)$(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} $<
349 362
350emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h) 363emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h)
351 $(CC) ${ALL_CFLAGS} $< \ 364 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< \
352 -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \ 365 -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \
353 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@ 366 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@
354 367
355emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h) 368emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h)
356 $(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows $< \ 369 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows $< \
357 -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \ 370 -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \
358 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@ 371 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@
359 372
@@ -365,13 +378,14 @@ NTDEPS = $(NTINC)/ms-w32.h $(NTINC)/sys/stat.h $(NTINC)/inttypes.h \
365# The dependency on $(NTDEPS) is a trick intended to cause recompile of 378# The dependency on $(NTDEPS) is a trick intended to cause recompile of
366# programs on MinGW whenever some private header in nt/inc is modified. 379# programs on MinGW whenever some private header in nt/inc is modified.
367ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h $(NTDEPS) 380ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h $(NTDEPS)
368 $(CC) -c ${CPP_CFLAGS} $< 381 $(AM_V_CC)$(CC) -c ${CPP_CFLAGS} $<
369 382
370hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h) 383hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h)
371 $(CC) ${ALL_CFLAGS} $< $(LOADLIBES) -o $@ 384 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(LOADLIBES) -o $@
372 385
373update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h) 386update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h)
374 $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \ 387 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} \
388 -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
375 $< $(LOADLIBES) $(NTLIB) -o $@ 389 $< $(LOADLIBES) $(NTLIB) -o $@
376 390
377emacsclient.res: $(NTINC)/../emacsclient.rc 391emacsclient.res: $(NTINC)/../emacsclient.rc
diff --git a/lib-src/etags.c b/lib-src/etags.c
index ae5491a8204..84ed03e375f 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -339,8 +339,6 @@ static char *skip_non_spaces (char *);
339static char *skip_name (char *); 339static char *skip_name (char *);
340static char *savenstr (const char *, int); 340static char *savenstr (const char *, int);
341static char *savestr (const char *); 341static char *savestr (const char *);
342static char *etags_strchr (const char *, int);
343static char *etags_strrchr (const char *, int);
344static char *etags_getcwd (void); 342static char *etags_getcwd (void);
345static char *relative_filename (char *, char *); 343static char *relative_filename (char *, char *);
346static char *absolute_filename (char *, char *); 344static char *absolute_filename (char *, char *);
@@ -1334,8 +1332,8 @@ get_compressor_from_suffix (char *file, char **extptr)
1334 1332
1335 /* File has been processed by canonicalize_filename, 1333 /* File has been processed by canonicalize_filename,
1336 so we don't need to consider backslashes on DOS_NT. */ 1334 so we don't need to consider backslashes on DOS_NT. */
1337 slash = etags_strrchr (file, '/'); 1335 slash = strrchr (file, '/');
1338 suffix = etags_strrchr (file, '.'); 1336 suffix = strrchr (file, '.');
1339 if (suffix == NULL || suffix < slash) 1337 if (suffix == NULL || suffix < slash)
1340 return NULL; 1338 return NULL;
1341 if (extptr != NULL) 1339 if (extptr != NULL)
@@ -1422,7 +1420,7 @@ get_language_from_filename (char *file, int case_sensitive)
1422 return lang; 1420 return lang;
1423 1421
1424 /* If not found, try suffix after last dot. */ 1422 /* If not found, try suffix after last dot. */
1425 suffix = etags_strrchr (file, '.'); 1423 suffix = strrchr (file, '.');
1426 if (suffix == NULL) 1424 if (suffix == NULL)
1427 return NULL; 1425 return NULL;
1428 suffix += 1; 1426 suffix += 1;
@@ -1699,7 +1697,7 @@ find_entries (FILE *inf)
1699 /* Set lp to point at the first char after the last slash in the 1697 /* Set lp to point at the first char after the last slash in the
1700 line or, if no slashes, at the first nonblank. Then set cp to 1698 line or, if no slashes, at the first nonblank. Then set cp to
1701 the first successive blank and terminate the string. */ 1699 the first successive blank and terminate the string. */
1702 lp = etags_strrchr (lb.buffer+2, '/'); 1700 lp = strrchr (lb.buffer+2, '/');
1703 if (lp != NULL) 1701 if (lp != NULL)
1704 lp += 1; 1702 lp += 1;
1705 else 1703 else
@@ -1884,9 +1882,9 @@ pfnote (char *name, bool is_func, char *linestart, int linelen, int lno,
1884 /* If ctags mode, change name "main" to M<thisfilename>. */ 1882 /* If ctags mode, change name "main" to M<thisfilename>. */
1885 if (CTAGS && !cxref_style && streq (name, "main")) 1883 if (CTAGS && !cxref_style && streq (name, "main"))
1886 { 1884 {
1887 register char *fp = etags_strrchr (curfdp->taggedfname, '/'); 1885 char *fp = strrchr (curfdp->taggedfname, '/');
1888 np->name = concat ("M", fp == NULL ? curfdp->taggedfname : fp + 1, ""); 1886 np->name = concat ("M", fp == NULL ? curfdp->taggedfname : fp + 1, "");
1889 fp = etags_strrchr (np->name, '.'); 1887 fp = strrchr (np->name, '.');
1890 if (fp != NULL && fp[1] != '\0' && fp[2] == '\0') 1888 if (fp != NULL && fp[1] != '\0' && fp[2] == '\0')
1891 fp[0] = '\0'; 1889 fp[0] = '\0';
1892 } 1890 }
@@ -4116,7 +4114,7 @@ Ada_funcs (FILE *inf)
4116 /* Skip a string i.e. "abcd". */ 4114 /* Skip a string i.e. "abcd". */
4117 if (inquote || (*dbp == '"')) 4115 if (inquote || (*dbp == '"'))
4118 { 4116 {
4119 dbp = etags_strchr (dbp + !inquote, '"'); 4117 dbp = strchr (dbp + !inquote, '"');
4120 if (dbp != NULL) 4118 if (dbp != NULL)
4121 { 4119 {
4122 inquote = false; 4120 inquote = false;
@@ -4274,7 +4272,7 @@ Perl_functions (FILE *inf)
4274 cp++; 4272 cp++;
4275 if (cp == sp) 4273 if (cp == sp)
4276 continue; /* nothing found */ 4274 continue; /* nothing found */
4277 if ((pos = etags_strchr (sp, ':')) != NULL 4275 if ((pos = strchr (sp, ':')) != NULL
4278 && pos < cp && pos[1] == ':') 4276 && pos < cp && pos[1] == ':')
4279 /* The name is already qualified. */ 4277 /* The name is already qualified. */
4280 make_tag (sp, cp - sp, true, 4278 make_tag (sp, cp - sp, true,
@@ -5029,7 +5027,7 @@ TEX_decode_env (const char *evarname, const char *defenv)
5029 5027
5030 /* Allocate a token table */ 5028 /* Allocate a token table */
5031 for (len = 1, p = env; p;) 5029 for (len = 1, p = env; p;)
5032 if ((p = etags_strchr (p, ':')) && *++p != '\0') 5030 if ((p = strchr (p, ':')) && *++p != '\0')
5033 len++; 5031 len++;
5034 TEX_toktab = xnew (len, linebuffer); 5032 TEX_toktab = xnew (len, linebuffer);
5035 5033
@@ -5037,7 +5035,7 @@ TEX_decode_env (const char *evarname, const char *defenv)
5037 /* zero-length strings (leading ':', "::" and trailing ':') */ 5035 /* zero-length strings (leading ':', "::" and trailing ':') */
5038 for (i = 0; *env != '\0';) 5036 for (i = 0; *env != '\0';)
5039 { 5037 {
5040 p = etags_strchr (env, ':'); 5038 p = strchr (env, ':');
5041 if (!p) /* End of environment string. */ 5039 if (!p) /* End of environment string. */
5042 p = env + strlen (env); 5040 p = env + strlen (env);
5043 if (p - env > 0) 5041 if (p - env > 0)
@@ -5767,9 +5765,9 @@ substitute (char *in, char *out, struct re_registers *regs)
5767 /* Pass 1: figure out how much to allocate by finding all \N strings. */ 5765 /* Pass 1: figure out how much to allocate by finding all \N strings. */
5768 if (out[size - 1] == '\\') 5766 if (out[size - 1] == '\\')
5769 fatal ("pattern error in \"%s\"", out); 5767 fatal ("pattern error in \"%s\"", out);
5770 for (t = etags_strchr (out, '\\'); 5768 for (t = strchr (out, '\\');
5771 t != NULL; 5769 t != NULL;
5772 t = etags_strchr (t + 2, '\\')) 5770 t = strchr (t + 2, '\\'))
5773 if (ISDIGIT (t[1])) 5771 if (ISDIGIT (t[1]))
5774 { 5772 {
5775 dig = t[1] - '0'; 5773 dig = t[1] - '0';
@@ -6051,7 +6049,7 @@ readline (linebuffer *lbp, FILE *stream)
6051 { 6049 {
6052 char *endp = lbp->buffer + start; 6050 char *endp = lbp->buffer + start;
6053 6051
6054 while ((endp = etags_strchr (endp, '"')) != NULL 6052 while ((endp = strchr (endp, '"')) != NULL
6055 && endp[-1] == '\\') 6053 && endp[-1] == '\\')
6056 endp++; 6054 endp++;
6057 if (endp != NULL) 6055 if (endp != NULL)
@@ -6236,43 +6234,6 @@ savenstr (const char *cp, int len)
6236 return memcpy (dp, cp, len); 6234 return memcpy (dp, cp, len);
6237} 6235}
6238 6236
6239/*
6240 * Return the ptr in sp at which the character c last
6241 * appears; NULL if not found
6242 *
6243 * Identical to POSIX strrchr, included for portability.
6244 */
6245static char *
6246etags_strrchr (register const char *sp, register int c)
6247{
6248 register const char *r;
6249
6250 r = NULL;
6251 do
6252 {
6253 if (*sp == c)
6254 r = sp;
6255 } while (*sp++);
6256 return (char *)r;
6257}
6258
6259/*
6260 * Return the ptr in sp at which the character c first
6261 * appears; NULL if not found
6262 *
6263 * Identical to POSIX strchr, included for portability.
6264 */
6265static char *
6266etags_strchr (register const char *sp, register int c)
6267{
6268 do
6269 {
6270 if (*sp == c)
6271 return (char *)sp;
6272 } while (*sp++);
6273 return NULL;
6274}
6275
6276/* Skip spaces (end of string is not space), return new pointer. */ 6237/* Skip spaces (end of string is not space), return new pointer. */
6277static char * 6238static char *
6278skip_spaces (char *cp) 6239skip_spaces (char *cp)
@@ -6398,7 +6359,7 @@ relative_filename (char *file, char *dir)
6398 6359
6399 /* Build a sequence of "../" strings for the resulting relative file name. */ 6360 /* Build a sequence of "../" strings for the resulting relative file name. */
6400 i = 0; 6361 i = 0;
6401 while ((dp = etags_strchr (dp + 1, '/')) != NULL) 6362 while ((dp = strchr (dp + 1, '/')) != NULL)
6402 i += 1; 6363 i += 1;
6403 res = xnew (3*i + strlen (fp + 1) + 1, char); 6364 res = xnew (3*i + strlen (fp + 1) + 1, char);
6404 res[0] = '\0'; 6365 res[0] = '\0';
@@ -6431,7 +6392,7 @@ absolute_filename (char *file, char *dir)
6431 res = concat (dir, file, ""); 6392 res = concat (dir, file, "");
6432 6393
6433 /* Delete the "/dirname/.." and "/." substrings. */ 6394 /* Delete the "/dirname/.." and "/." substrings. */
6434 slashp = etags_strchr (res, '/'); 6395 slashp = strchr (res, '/');
6435 while (slashp != NULL && slashp[0] != '\0') 6396 while (slashp != NULL && slashp[0] != '\0')
6436 { 6397 {
6437 if (slashp[1] == '.') 6398 if (slashp[1] == '.')
@@ -6463,7 +6424,7 @@ absolute_filename (char *file, char *dir)
6463 } 6424 }
6464 } 6425 }
6465 6426
6466 slashp = etags_strchr (slashp + 1, '/'); 6427 slashp = strchr (slashp + 1, '/');
6467 } 6428 }
6468 6429
6469 if (res[0] == '\0') /* just a safety net: should never happen */ 6430 if (res[0] == '\0') /* just a safety net: should never happen */
@@ -6484,7 +6445,7 @@ absolute_dirname (char *file, char *dir)
6484 char *slashp, *res; 6445 char *slashp, *res;
6485 char save; 6446 char save;
6486 6447
6487 slashp = etags_strrchr (file, '/'); 6448 slashp = strrchr (file, '/');
6488 if (slashp == NULL) 6449 if (slashp == NULL)
6489 return savestr (dir); 6450 return savestr (dir);
6490 save = slashp[1]; 6451 save = slashp[1];
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index c600fc0ea53..b0196b309d8 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -714,8 +714,8 @@ popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse
714 714
715 for (i = start; i * increment <= end * increment; i += increment) 715 for (i = start; i * increment <= end * increment; i += increment)
716 { 716 {
717 mbx_delimit_begin (mbf); 717 if (mbx_delimit_begin (mbf) != OK
718 if (pop_retr (server, i, mbf) != OK) 718 || pop_retr (server, i, mbf) != OK)
719 { 719 {
720 error ("%s", Errmsg, 0); 720 error ("%s", Errmsg, 0);
721 close (mbfi); 721 close (mbfi);
@@ -832,15 +832,15 @@ mbx_write (char *line, int len, FILE *mbf)
832static int 832static int
833mbx_delimit_begin (FILE *mbf) 833mbx_delimit_begin (FILE *mbf)
834{ 834{
835 time_t now; 835 time_t now = time (NULL);
836 struct tm *ltime; 836 struct tm *ltime = localtime (&now);
837 char fromline[40] = "From movemail "; 837 if (!ltime)
838 838 return NOTOK;
839 now = time (NULL); 839
840 ltime = localtime (&now); 840 char fromline[100];
841 841 if (! strftime (fromline, sizeof fromline,
842 strcat (fromline, asctime (ltime)); 842 "From movemail %a %b %e %T %Y\n", ltime))
843 843 return NOTOK;
844 if (fputs (fromline, mbf) == EOF) 844 if (fputs (fromline, mbf) == EOF)
845 return (NOTOK); 845 return (NOTOK);
846 return (OK); 846 return (OK);