aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2011-02-21 16:11:56 -0800
committerPaul Eggert2011-02-21 16:11:56 -0800
commit5ecec6a7f4a1ce83abd53a14fba7f51b668c6336 (patch)
tree2b0d1479e48d345d68d923e94bbd9f8fd4d512e4 /lib-src
parentd47d631945f07360195c26452bd7d3f991d7e6c6 (diff)
downloademacs-5ecec6a7f4a1ce83abd53a14fba7f51b668c6336.tar.gz
emacs-5ecec6a7f4a1ce83abd53a14fba7f51b668c6336.zip
* movemail.c: Define macros only in needed contexts.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/movemail.c13
2 files changed, 16 insertions, 2 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 1d0f24212ad..7aa13a45cba 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -14,8 +14,9 @@
14 14
15 * movemail.c (main, pop_retr): Rename locals to avoid shadowing. 15 * movemail.c (main, pop_retr): Rename locals to avoid shadowing.
16 (progname, sfi, sfo, ibuffer, obuffer): Remove unused vars. 16 (progname, sfi, sfo, ibuffer, obuffer): Remove unused vars.
17 (DIRECTORY_SEP, IS_DIRECTORY_SEP, DONE, IS_FROM_LINE): 17 (DONE): Remove unused macro.
18 Remove unused macros. 18 (DIRECTORY_SEP, IS_DIRECTORY_SEP, IS_FROM_LINE):
19 Define these macros only in the contexts that need them.
19 * pop.c (index): Remove unused macro. 20 * pop.c (index): Remove unused macro.
20 (KPOP_PORT): Define only if KERBEROS is defined. 21 (KPOP_PORT): Define only if KERBEROS is defined.
21 22
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index bc7fa8824e2..4a894c1cba1 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -262,6 +262,13 @@ main (int argc, char **argv)
262 if (! spool_name) 262 if (! spool_name)
263#endif 263#endif
264 { 264 {
265 #ifndef DIRECTORY_SEP
266 #define DIRECTORY_SEP '/'
267 #endif
268 #ifndef IS_DIRECTORY_SEP
269 #define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
270 #endif
271
265 /* Use a lock file named after our first argument with .lock appended: 272 /* Use a lock file named after our first argument with .lock appended:
266 If it exists, the mail file is locked. */ 273 If it exists, the mail file is locked. */
267 /* Note: this locking mechanism is *required* by the mailer 274 /* Note: this locking mechanism is *required* by the mailer
@@ -862,6 +869,12 @@ static int
862mbx_write (char *line, int len, FILE *mbf) 869mbx_write (char *line, int len, FILE *mbf)
863{ 870{
864#ifdef MOVEMAIL_QUOTE_POP_FROM_LINES 871#ifdef MOVEMAIL_QUOTE_POP_FROM_LINES
872 /* Do this as a macro instead of using strcmp to save on execution time. */
873 # define IS_FROM_LINE(a) ((a[0] == 'F') \
874 && (a[1] == 'r') \
875 && (a[2] == 'o') \
876 && (a[3] == 'm') \
877 && (a[4] == ' '))
865 if (IS_FROM_LINE (line)) 878 if (IS_FROM_LINE (line))
866 { 879 {
867 if (fputc ('>', mbf) == EOF) 880 if (fputc ('>', mbf) == EOF)