diff options
| author | Miles Bader | 2008-01-30 07:57:28 +0000 |
|---|---|---|
| committer | Miles Bader | 2008-01-30 07:57:28 +0000 |
| commit | d235ca2ff8fab139ce797757fcb159d1e28fa7e0 (patch) | |
| tree | 96c5cd1a06a0d9dc26e8470c6eabfc032c0046f3 /lib-src | |
| parent | 3709a060f679dba14df71ae64a0035fa2b5b3106 (diff) | |
| parent | 02cbe062bee38a6705bafb1699d77e3c44cfafcf (diff) | |
| download | emacs-d235ca2ff8fab139ce797757fcb159d1e28fa7e0.tar.gz emacs-d235ca2ff8fab139ce797757fcb159d1e28fa7e0.zip | |
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-324
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 45 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 47 | ||||
| -rw-r--r-- | lib-src/make-docfile.c | 4 | ||||
| -rw-r--r-- | lib-src/movemail.c | 16 | ||||
| -rw-r--r-- | lib-src/pop.c | 35 |
5 files changed, 108 insertions, 39 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 8cdce18bd87..9ebfbc29ecd 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,48 @@ | |||
| 1 | 2008-01-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacsclient.c (decode_options): Default to a NULL display, as Emacs-22. | ||
| 4 | Allow the -d option under w32 again, for those rare cases where it | ||
| 5 | actually does make sense. | ||
| 6 | |||
| 7 | 2008-01-25 Juanma Barranquero <lekktu@gmail.com> | ||
| 8 | |||
| 9 | * emacsclient.c (set_tcp_socket): Don't send "\n" after | ||
| 10 | the authentication string; there's no need to haste. | ||
| 11 | |||
| 12 | 2008-01-22 Chong Yidong <cyd@stupidchicken.com> | ||
| 13 | |||
| 14 | * pop.c (pop_stat, pop_last): Fix last fix. | ||
| 15 | |||
| 16 | 2008-01-18 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 17 | |||
| 18 | * movemail.c: Remove references to XENIX. | ||
| 19 | |||
| 20 | 2008-01-13 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 21 | |||
| 22 | * movemail.c: | ||
| 23 | * make-docfile.c: Remove reference to symbols defined by systems | ||
| 24 | not supported anymore: MAC_OS8, XENIX and STRIDE. | ||
| 25 | |||
| 26 | 2008-01-12 Eli Zaretskii <eliz@gnu.org> | ||
| 27 | |||
| 28 | * emacsclient.c (decode_options) [WINDOWSNT]: Don't use the value | ||
| 29 | of DISPLAY in the environment. Don't support -d. | ||
| 30 | (print_help_and_exit) [WINDOWSNT]: Don't show the --display option. | ||
| 31 | (longopts) [WINDOWSNT]: Remove --display. | ||
| 32 | |||
| 33 | 2008-01-10 Chong Yidong <cyd@stupidchicken.com> | ||
| 34 | |||
| 35 | * pop.c (pop_stat, pop_last): Check validity of string-to-integer | ||
| 36 | conversion. Mistakes spotted by Nico Golde. | ||
| 37 | |||
| 38 | 2008-01-09 Glenn Morris <rgm@gnu.org> | ||
| 39 | |||
| 40 | * emacsclient.c: Add missing final newlines to message calls. | ||
| 41 | |||
| 42 | 2008-01-09 Daniel Hackney <dan@haxney.org> (tiny change) | ||
| 43 | |||
| 44 | * emacsclient.c (set_socket): Add final newline to socket error message. | ||
| 45 | |||
| 1 | 2008-01-04 Glenn Morris <rgm@gnu.org> | 46 | 2008-01-04 Glenn Morris <rgm@gnu.org> |
| 2 | 47 | ||
| 3 | * ebrowse.c (version) <emacs_copyright>: New variable. | 48 | * ebrowse.c (version) <emacs_copyright>: New variable. |
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 9de812d1c73..707be43b5f7 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -170,7 +170,9 @@ struct option longopts[] = | |||
| 170 | { "socket-name", required_argument, NULL, 's' }, | 170 | { "socket-name", required_argument, NULL, 's' }, |
| 171 | #endif | 171 | #endif |
| 172 | { "server-file", required_argument, NULL, 'f' }, | 172 | { "server-file", required_argument, NULL, 'f' }, |
| 173 | #ifndef WINDOWSNT | ||
| 173 | { "display", required_argument, NULL, 'd' }, | 174 | { "display", required_argument, NULL, 'd' }, |
| 175 | #endif | ||
| 174 | { 0, 0, 0, 0 } | 176 | { 0, 0, 0, 0 } |
| 175 | }; | 177 | }; |
| 176 | 178 | ||
| @@ -227,7 +229,7 @@ xstrdup (const char *s) | |||
| 227 | 229 | ||
| 228 | 230 | ||
| 229 | /* Return the current working directory. Returns NULL on errors. | 231 | /* Return the current working directory. Returns NULL on errors. |
| 230 | Any other returned value must be freed with free. This is used | 232 | Any other returned value must be freed with free. This is used |
| 231 | only when get_current_dir_name is not defined on the system. */ | 233 | only when get_current_dir_name is not defined on the system. */ |
| 232 | char* | 234 | char* |
| 233 | get_current_dir_name () | 235 | get_current_dir_name () |
| @@ -477,9 +479,15 @@ decode_options (argc, argv) | |||
| 477 | char **argv; | 479 | char **argv; |
| 478 | { | 480 | { |
| 479 | alternate_editor = egetenv ("ALTERNATE_EDITOR"); | 481 | alternate_editor = egetenv ("ALTERNATE_EDITOR"); |
| 482 | |||
| 483 | /* We used to set `display' to $DISPLAY by default, but this changed the | ||
| 484 | default behavior and is sometimes inconvenient. So instead of forcing | ||
| 485 | users to say "--display ''" when they want to use Emacs's existing tty | ||
| 486 | or display connection, we force them to use "--display $DISPLAY" if | ||
| 487 | they want Emacs to connect to their current display. */ | ||
| 488 | #if 0 | ||
| 480 | display = egetenv ("DISPLAY"); | 489 | display = egetenv ("DISPLAY"); |
| 481 | if (display && strlen (display) == 0) | 490 | #endif |
| 482 | display = NULL; | ||
| 483 | 491 | ||
| 484 | while (1) | 492 | while (1) |
| 485 | { | 493 | { |
| @@ -515,9 +523,15 @@ decode_options (argc, argv) | |||
| 515 | server_file = optarg; | 523 | server_file = optarg; |
| 516 | break; | 524 | break; |
| 517 | 525 | ||
| 526 | /* We used to disallow this argument in w32, but it seems better | ||
| 527 | to allow it, for the occasional case where the user is | ||
| 528 | connecting with a w32 client to a server compiled with X11 | ||
| 529 | support. */ | ||
| 530 | #if 1 /* !defined WINDOWS */ | ||
| 518 | case 'd': | 531 | case 'd': |
| 519 | display = optarg; | 532 | display = optarg; |
| 520 | break; | 533 | break; |
| 534 | #endif | ||
| 521 | 535 | ||
| 522 | case 'n': | 536 | case 'n': |
| 523 | nowait = 1; | 537 | nowait = 1; |
| @@ -552,6 +566,9 @@ decode_options (argc, argv) | |||
| 552 | } | 566 | } |
| 553 | } | 567 | } |
| 554 | 568 | ||
| 569 | if (display && strlen (display) == 0) | ||
| 570 | display = NULL; | ||
| 571 | |||
| 555 | if (!tty && display) | 572 | if (!tty && display) |
| 556 | window_system = 1; | 573 | window_system = 1; |
| 557 | #if !defined (WINDOWSNT) && !defined (HAVE_CARBON) | 574 | #if !defined (WINDOWSNT) && !defined (HAVE_CARBON) |
| @@ -594,8 +611,10 @@ The following OPTIONS are accepted:\n\ | |||
| 594 | -c, --create-frame Create a new frame instead of trying to\n\ | 611 | -c, --create-frame Create a new frame instead of trying to\n\ |
| 595 | use the current Emacs frame\n\ | 612 | use the current Emacs frame\n\ |
| 596 | -e, --eval Evaluate the FILE arguments as ELisp expressions\n\ | 613 | -e, --eval Evaluate the FILE arguments as ELisp expressions\n\ |
| 597 | -n, --no-wait Don't wait for the server to return\n\ | 614 | -n, --no-wait Don't wait for the server to return\n" |
| 598 | -d, --display=DISPLAY Visit the file in the given display\n" | 615 | #ifndef WINDOWSNT |
| 616 | "-d, --display=DISPLAY Visit the file in the given display\n" | ||
| 617 | #endif | ||
| 599 | #ifndef NO_SOCKETS_IN_FILE_SYSTEM | 618 | #ifndef NO_SOCKETS_IN_FILE_SYSTEM |
| 600 | "-s, --socket-name=FILENAME\n\ | 619 | "-s, --socket-name=FILENAME\n\ |
| 601 | Set filename of the UNIX socket for communication\n" | 620 | Set filename of the UNIX socket for communication\n" |
| @@ -882,7 +901,7 @@ initialize_sockets () | |||
| 882 | 901 | ||
| 883 | if (WSAStartup (MAKEWORD (2, 0), &wsaData)) | 902 | if (WSAStartup (MAKEWORD (2, 0), &wsaData)) |
| 884 | { | 903 | { |
| 885 | message (TRUE, "%s: error initializing WinSock2", progname); | 904 | message (TRUE, "%s: error initializing WinSock2\n", progname); |
| 886 | exit (EXIT_FAILURE); | 905 | exit (EXIT_FAILURE); |
| 887 | } | 906 | } |
| 888 | 907 | ||
| @@ -939,7 +958,7 @@ get_server_config (server, authentication) | |||
| 939 | } | 958 | } |
| 940 | else | 959 | else |
| 941 | { | 960 | { |
| 942 | message (TRUE, "%s: invalid configuration info", progname); | 961 | message (TRUE, "%s: invalid configuration info\n", progname); |
| 943 | exit (EXIT_FAILURE); | 962 | exit (EXIT_FAILURE); |
| 944 | } | 963 | } |
| 945 | 964 | ||
| @@ -949,7 +968,7 @@ get_server_config (server, authentication) | |||
| 949 | 968 | ||
| 950 | if (! fread (authentication, AUTH_KEY_LENGTH, 1, config)) | 969 | if (! fread (authentication, AUTH_KEY_LENGTH, 1, config)) |
| 951 | { | 970 | { |
| 952 | message (TRUE, "%s: cannot read authentication info", progname); | 971 | message (TRUE, "%s: cannot read authentication info\n", progname); |
| 953 | exit (EXIT_FAILURE); | 972 | exit (EXIT_FAILURE); |
| 954 | } | 973 | } |
| 955 | 974 | ||
| @@ -1002,7 +1021,7 @@ set_tcp_socket () | |||
| 1002 | 1021 | ||
| 1003 | send_to_emacs (s, "-auth "); | 1022 | send_to_emacs (s, "-auth "); |
| 1004 | send_to_emacs (s, auth_string); | 1023 | send_to_emacs (s, auth_string); |
| 1005 | send_to_emacs (s, "\n"); | 1024 | send_to_emacs (s, " "); |
| 1006 | 1025 | ||
| 1007 | return s; | 1026 | return s; |
| 1008 | } | 1027 | } |
| @@ -1092,7 +1111,7 @@ handle_sigtstp (int signalnum) | |||
| 1092 | if (emacs_socket) | 1111 | if (emacs_socket) |
| 1093 | send_to_emacs (emacs_socket, "-suspend \n"); | 1112 | send_to_emacs (emacs_socket, "-suspend \n"); |
| 1094 | 1113 | ||
| 1095 | /* Unblock this signal and call the default handler by temprarily | 1114 | /* Unblock this signal and call the default handler by temporarily |
| 1096 | changing the handler and resignalling. */ | 1115 | changing the handler and resignalling. */ |
| 1097 | sigprocmask (SIG_BLOCK, NULL, &set); | 1116 | sigprocmask (SIG_BLOCK, NULL, &set); |
| 1098 | sigdelset (&set, signalnum); | 1117 | sigdelset (&set, signalnum); |
| @@ -1167,7 +1186,7 @@ set_local_socket () | |||
| 1167 | strcpy (server.sun_path, socket_name); | 1186 | strcpy (server.sun_path, socket_name); |
| 1168 | else | 1187 | else |
| 1169 | { | 1188 | { |
| 1170 | message (TRUE, "%s: socket-name %s too long", | 1189 | message (TRUE, "%s: socket-name %s too long\n", |
| 1171 | progname, socket_name); | 1190 | progname, socket_name); |
| 1172 | fail (); | 1191 | fail (); |
| 1173 | } | 1192 | } |
| @@ -1202,7 +1221,7 @@ set_local_socket () | |||
| 1202 | strcpy (server.sun_path, socket_name); | 1221 | strcpy (server.sun_path, socket_name); |
| 1203 | else | 1222 | else |
| 1204 | { | 1223 | { |
| 1205 | message (TRUE, "%s: socket-name %s too long", | 1224 | message (TRUE, "%s: socket-name %s too long\n", |
| 1206 | progname, socket_name); | 1225 | progname, socket_name); |
| 1207 | exit (EXIT_FAILURE); | 1226 | exit (EXIT_FAILURE); |
| 1208 | } | 1227 | } |
| @@ -1266,7 +1285,7 @@ set_socket () | |||
| 1266 | s = set_local_socket (); | 1285 | s = set_local_socket (); |
| 1267 | if ((s != INVALID_SOCKET) || alternate_editor) | 1286 | if ((s != INVALID_SOCKET) || alternate_editor) |
| 1268 | return s; | 1287 | return s; |
| 1269 | message (TRUE, "%s: error accessing socket \"%s\"", | 1288 | message (TRUE, "%s: error accessing socket \"%s\"\n", |
| 1270 | progname, socket_name); | 1289 | progname, socket_name); |
| 1271 | exit (EXIT_FAILURE); | 1290 | exit (EXIT_FAILURE); |
| 1272 | } | 1291 | } |
| @@ -1282,7 +1301,7 @@ set_socket () | |||
| 1282 | if ((s != INVALID_SOCKET) || alternate_editor) | 1301 | if ((s != INVALID_SOCKET) || alternate_editor) |
| 1283 | return s; | 1302 | return s; |
| 1284 | 1303 | ||
| 1285 | message (TRUE, "%s: error accessing server file \"%s\"", | 1304 | message (TRUE, "%s: error accessing server file \"%s\"\n", |
| 1286 | progname, server_file); | 1305 | progname, server_file); |
| 1287 | exit (EXIT_FAILURE); | 1306 | exit (EXIT_FAILURE); |
| 1288 | } | 1307 | } |
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 1564aca5bbe..6e22eb857e3 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c | |||
| @@ -62,11 +62,7 @@ Boston, MA 02110-1301, USA. */ | |||
| 62 | #endif /* not DOS_NT */ | 62 | #endif /* not DOS_NT */ |
| 63 | 63 | ||
| 64 | #ifndef DIRECTORY_SEP | 64 | #ifndef DIRECTORY_SEP |
| 65 | #ifdef MAC_OS8 | ||
| 66 | #define DIRECTORY_SEP ':' | ||
| 67 | #else /* not MAC_OS8 */ | ||
| 68 | #define DIRECTORY_SEP '/' | 65 | #define DIRECTORY_SEP '/' |
| 69 | #endif /* not MAC_OS8 */ | ||
| 70 | #endif | 66 | #endif |
| 71 | 67 | ||
| 72 | #ifndef IS_DIRECTORY_SEP | 68 | #ifndef IS_DIRECTORY_SEP |
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 7c647676ff5..1f95735878d 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c | |||
| @@ -113,7 +113,7 @@ Boston, MA 02110-1301, USA. */ | |||
| 113 | #define R_OK 4 | 113 | #define R_OK 4 |
| 114 | #endif | 114 | #endif |
| 115 | 115 | ||
| 116 | #if defined (XENIX) || defined (WINDOWSNT) | 116 | #ifdef WINDOWSNT |
| 117 | #include <sys/locking.h> | 117 | #include <sys/locking.h> |
| 118 | #endif | 118 | #endif |
| 119 | 119 | ||
| @@ -388,13 +388,13 @@ main (argc, argv) | |||
| 388 | if (indesc < 0) | 388 | if (indesc < 0) |
| 389 | pfatal_with_name (inname); | 389 | pfatal_with_name (inname); |
| 390 | 390 | ||
| 391 | #if defined (BSD_SYSTEM) || defined (XENIX) | 391 | #ifdef BSD_SYSTEM |
| 392 | /* In case movemail is setuid to root, make sure the user can | 392 | /* In case movemail is setuid to root, make sure the user can |
| 393 | read the output file. */ | 393 | read the output file. */ |
| 394 | /* This is desirable for all systems | 394 | /* This is desirable for all systems |
| 395 | but I don't want to assume all have the umask system call */ | 395 | but I don't want to assume all have the umask system call */ |
| 396 | umask (umask (0) & 0333); | 396 | umask (umask (0) & 0333); |
| 397 | #endif /* BSD_SYSTEM || XENIX */ | 397 | #endif /* BSD_SYSTEM */ |
| 398 | outdesc = open (outname, O_WRONLY | O_CREAT | O_EXCL, 0666); | 398 | outdesc = open (outname, O_WRONLY | O_CREAT | O_EXCL, 0666); |
| 399 | if (outdesc < 0) | 399 | if (outdesc < 0) |
| 400 | pfatal_with_name (outname); | 400 | pfatal_with_name (outname); |
| @@ -422,15 +422,11 @@ main (argc, argv) | |||
| 422 | #ifdef MAIL_USE_LOCKF | 422 | #ifdef MAIL_USE_LOCKF |
| 423 | status = lockf (indesc, F_LOCK, 0); | 423 | status = lockf (indesc, F_LOCK, 0); |
| 424 | #else /* not MAIL_USE_LOCKF */ | 424 | #else /* not MAIL_USE_LOCKF */ |
| 425 | #ifdef XENIX | ||
| 426 | status = locking (indesc, LK_RLCK, 0L); | ||
| 427 | #else | ||
| 428 | #ifdef WINDOWSNT | 425 | #ifdef WINDOWSNT |
| 429 | status = locking (indesc, LK_RLCK, -1L); | 426 | status = locking (indesc, LK_RLCK, -1L); |
| 430 | #else | 427 | #else |
| 431 | status = flock (indesc, LOCK_EX); | 428 | status = flock (indesc, LOCK_EX); |
| 432 | #endif | 429 | #endif |
| 433 | #endif | ||
| 434 | #endif /* not MAIL_USE_LOCKF */ | 430 | #endif /* not MAIL_USE_LOCKF */ |
| 435 | #endif /* MAIL_USE_SYSTEM_LOCK */ | 431 | #endif /* MAIL_USE_SYSTEM_LOCK */ |
| 436 | } | 432 | } |
| @@ -503,13 +499,7 @@ main (argc, argv) | |||
| 503 | #ifdef MAIL_USE_SYSTEM_LOCK | 499 | #ifdef MAIL_USE_SYSTEM_LOCK |
| 504 | if (! preserve_mail) | 500 | if (! preserve_mail) |
| 505 | { | 501 | { |
| 506 | #if defined (STRIDE) || defined (XENIX) | ||
| 507 | /* Stride, xenix have file locking, but no ftruncate. | ||
| 508 | This mess will do. */ | ||
| 509 | close (open (inname, O_CREAT | O_TRUNC | O_RDWR, 0666)); | ||
| 510 | #else | ||
| 511 | ftruncate (indesc, 0L); | 502 | ftruncate (indesc, 0L); |
| 512 | #endif /* STRIDE or XENIX */ | ||
| 513 | } | 503 | } |
| 514 | #endif /* MAIL_USE_SYSTEM_LOCK */ | 504 | #endif /* MAIL_USE_SYSTEM_LOCK */ |
| 515 | 505 | ||
diff --git a/lib-src/pop.c b/lib-src/pop.c index 61c90abe2bf..f15a3fb23b6 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c | |||
| @@ -352,6 +352,7 @@ pop_stat (server, count, size) | |||
| 352 | int *size; | 352 | int *size; |
| 353 | { | 353 | { |
| 354 | char *fromserver; | 354 | char *fromserver; |
| 355 | char *end_ptr; | ||
| 355 | 356 | ||
| 356 | if (server->in_multi) | 357 | if (server->in_multi) |
| 357 | { | 358 | { |
| @@ -377,18 +378,26 @@ pop_stat (server, count, size) | |||
| 377 | return (-1); | 378 | return (-1); |
| 378 | } | 379 | } |
| 379 | 380 | ||
| 380 | *count = atoi (&fromserver[4]); | 381 | errno = 0; |
| 381 | 382 | *count = strtol (&fromserver[4], &end_ptr, 10); | |
| 382 | fromserver = index (&fromserver[4], ' '); | 383 | /* Check validity of string-to-integer conversion. */ |
| 383 | if (! fromserver) | 384 | if (fromserver + 4 == end_ptr || *end_ptr != ' ' || errno) |
| 384 | { | 385 | { |
| 385 | strcpy (pop_error, | 386 | strcpy (pop_error, "Unexpected response from POP server in pop_stat"); |
| 386 | "Badly formatted response from server in pop_stat"); | ||
| 387 | pop_trash (server); | 387 | pop_trash (server); |
| 388 | return (-1); | 388 | return (-1); |
| 389 | } | 389 | } |
| 390 | 390 | ||
| 391 | *size = atoi (fromserver + 1); | 391 | fromserver = end_ptr; |
| 392 | |||
| 393 | errno = 0; | ||
| 394 | *size = strtol (fromserver + 1, &end_ptr, 10); | ||
| 395 | if (fromserver + 1 == end_ptr || errno) | ||
| 396 | { | ||
| 397 | strcpy (pop_error, "Unexpected response from POP server in pop_stat"); | ||
| 398 | pop_trash (server); | ||
| 399 | return (-1); | ||
| 400 | } | ||
| 392 | 401 | ||
| 393 | return (0); | 402 | return (0); |
| 394 | } | 403 | } |
| @@ -913,7 +922,17 @@ pop_last (server) | |||
| 913 | } | 922 | } |
| 914 | else | 923 | else |
| 915 | { | 924 | { |
| 916 | return (atoi (&fromserver[4])); | 925 | char *end_ptr; |
| 926 | int count; | ||
| 927 | errno = 0; | ||
| 928 | count = strtol (&fromserver[4], &end_ptr, 10); | ||
| 929 | if (fromserver + 4 == end_ptr || errno) | ||
| 930 | { | ||
| 931 | strcpy (pop_error, "Unexpected response from server in pop_last"); | ||
| 932 | pop_trash (server); | ||
| 933 | return (-1); | ||
| 934 | } | ||
| 935 | return count; | ||
| 917 | } | 936 | } |
| 918 | } | 937 | } |
| 919 | 938 | ||