Commit 5ecec6a7 authored by Paul Eggert's avatar Paul Eggert
Browse files

* movemail.c: Define macros only in needed contexts.

parent d47d6319
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
* movemail.c (main, pop_retr): Rename locals to avoid shadowing. * movemail.c (main, pop_retr): Rename locals to avoid shadowing.
(progname, sfi, sfo, ibuffer, obuffer): Remove unused vars. (progname, sfi, sfo, ibuffer, obuffer): Remove unused vars.
(DIRECTORY_SEP, IS_DIRECTORY_SEP, DONE, IS_FROM_LINE): (DONE): Remove unused macro.
Remove unused macros. (DIRECTORY_SEP, IS_DIRECTORY_SEP, IS_FROM_LINE):
Define these macros only in the contexts that need them.
* pop.c (index): Remove unused macro. * pop.c (index): Remove unused macro.
(KPOP_PORT): Define only if KERBEROS is defined. (KPOP_PORT): Define only if KERBEROS is defined.
......
...@@ -262,6 +262,13 @@ main (int argc, char **argv) ...@@ -262,6 +262,13 @@ main (int argc, char **argv)
if (! spool_name) if (! spool_name)
#endif #endif
{ {
#ifndef DIRECTORY_SEP
#define DIRECTORY_SEP '/'
#endif
#ifndef IS_DIRECTORY_SEP
#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
#endif
/* Use a lock file named after our first argument with .lock appended: /* Use a lock file named after our first argument with .lock appended:
If it exists, the mail file is locked. */ If it exists, the mail file is locked. */
/* Note: this locking mechanism is *required* by the mailer /* Note: this locking mechanism is *required* by the mailer
...@@ -862,6 +869,12 @@ static int ...@@ -862,6 +869,12 @@ static int
mbx_write (char *line, int len, FILE *mbf) mbx_write (char *line, int len, FILE *mbf)
{ {
#ifdef MOVEMAIL_QUOTE_POP_FROM_LINES #ifdef MOVEMAIL_QUOTE_POP_FROM_LINES
/* Do this as a macro instead of using strcmp to save on execution time. */
# define IS_FROM_LINE(a) ((a[0] == 'F') \
&& (a[1] == 'r') \
&& (a[2] == 'o') \
&& (a[3] == 'm') \
&& (a[4] == ' '))
if (IS_FROM_LINE (line)) if (IS_FROM_LINE (line))
{ {
if (fputc ('>', mbf) == EOF) if (fputc ('>', mbf) == EOF)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment