diff options
| author | Glenn Morris | 2012-12-21 11:32:43 -0800 |
|---|---|---|
| committer | Glenn Morris | 2012-12-21 11:32:43 -0800 |
| commit | a4b0cca119b01dc55bad802ef696c857fe014482 (patch) | |
| tree | f2df86b3d472d15d3bbb69274325a7c0090f65b3 /src | |
| parent | 0e9c7693712014196946a83709a83c08a7dfea25 (diff) | |
| parent | 160b3852018831b830a7451f29f770fb49810342 (diff) | |
| download | emacs-a4b0cca119b01dc55bad802ef696c857fe014482.tar.gz emacs-a4b0cca119b01dc55bad802ef696c857fe014482.zip | |
Merge from emacs-24; up to 2012-12-01T13:25:13Z!cyd@gnu.org
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 28 | ||||
| -rw-r--r-- | src/buffer.c | 2 | ||||
| -rw-r--r-- | src/fileio.c | 5 | ||||
| -rw-r--r-- | src/fns.c | 18 | ||||
| -rw-r--r-- | src/search.c | 7 | ||||
| -rw-r--r-- | src/w32.c | 39 | ||||
| -rw-r--r-- | src/w32proc.c | 10 |
7 files changed, 66 insertions, 43 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 24f32f141e9..acd8d4481e7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,31 @@ | |||
| 1 | 2012-12-21 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * fileio.c (Finsert_file_contents): Doc fix. | ||
| 4 | |||
| 5 | * w32proc.c (new_child, delete_child, find_child_pid): For a | ||
| 6 | subprocess, consider its slot being in use as long as its process | ||
| 7 | handle (procinfo.hProcess) is not NULL. This avoids reusing the | ||
| 8 | slot when a new process is started immediately after killing | ||
| 9 | another one, without waiting enough time for the first process to | ||
| 10 | be reaped and resources allocated for it be orderly freed. | ||
| 11 | (Bug#13086) | ||
| 12 | Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>. | ||
| 13 | |||
| 14 | 2012-12-21 Chong Yidong <cyd@gnu.org> | ||
| 15 | |||
| 16 | * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231). | ||
| 17 | |||
| 18 | * fns.c (Fcompare_strings): Doc fix (Bug#13081). | ||
| 19 | |||
| 20 | 2012-12-21 Eli Zaretskii <eliz@gnu.org> | ||
| 21 | |||
| 22 | * w32.c (get_name_and_id): Always pass NULL as the first argument | ||
| 23 | of lookup_account_sid. Avoids crashes with UNC file names that | ||
| 24 | refer to DFS domains, not to specific machine names. (Bug#12621) | ||
| 25 | Remove now unused argument FNAME; all callers changed. | ||
| 26 | (get_file_owner_and_group): Remove now unused argument FNAME; all | ||
| 27 | callers changed. | ||
| 28 | |||
| 1 | 2012-12-21 Chong Yidong <cyd@gnu.org> | 29 | 2012-12-21 Chong Yidong <cyd@gnu.org> |
| 2 | 30 | ||
| 3 | * editfns.c (Finsert_char): Since read-char-by-name now signals an | 31 | * editfns.c (Finsert_char): Since read-char-by-name now signals an |
diff --git a/src/buffer.c b/src/buffer.c index 748422df73a..3cf590d4db7 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -2049,7 +2049,7 @@ DEFUN ("bury-buffer-internal", Fbury_buffer_internal, Sbury_buffer_internal, | |||
| 2049 | DEFUN ("set-buffer-major-mode", Fset_buffer_major_mode, Sset_buffer_major_mode, 1, 1, 0, | 2049 | DEFUN ("set-buffer-major-mode", Fset_buffer_major_mode, Sset_buffer_major_mode, 1, 1, 0, |
| 2050 | doc: /* Set an appropriate major mode for BUFFER. | 2050 | doc: /* Set an appropriate major mode for BUFFER. |
| 2051 | For the *scratch* buffer, use `initial-major-mode', otherwise choose a mode | 2051 | For the *scratch* buffer, use `initial-major-mode', otherwise choose a mode |
| 2052 | according to `default-major-mode'. | 2052 | according to the default value of `major-mode'. |
| 2053 | Use this function before selecting the buffer, since it may need to inspect | 2053 | Use this function before selecting the buffer, since it may need to inspect |
| 2054 | the current buffer's major mode. */) | 2054 | the current buffer's major mode. */) |
| 2055 | (Lisp_Object buffer) | 2055 | (Lisp_Object buffer) |
diff --git a/src/fileio.c b/src/fileio.c index 45f3b77d721..50fbaa7ff04 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3417,7 +3417,10 @@ the number of characters that replace previous buffer contents. | |||
| 3417 | 3417 | ||
| 3418 | This function does code conversion according to the value of | 3418 | This function does code conversion according to the value of |
| 3419 | `coding-system-for-read' or `file-coding-system-alist', and sets the | 3419 | `coding-system-for-read' or `file-coding-system-alist', and sets the |
| 3420 | variable `last-coding-system-used' to the coding system actually used. */) | 3420 | variable `last-coding-system-used' to the coding system actually used. |
| 3421 | |||
| 3422 | In addition, this function decodes the inserted text from known formats | ||
| 3423 | by calling `format-decode', which see. */) | ||
| 3421 | (Lisp_Object filename, Lisp_Object visit, Lisp_Object beg, Lisp_Object end, Lisp_Object replace) | 3424 | (Lisp_Object filename, Lisp_Object visit, Lisp_Object beg, Lisp_Object end, Lisp_Object replace) |
| 3422 | { | 3425 | { |
| 3423 | struct stat st; | 3426 | struct stat st; |
| @@ -211,12 +211,18 @@ Symbols are also allowed; their print names are used instead. */) | |||
| 211 | 211 | ||
| 212 | DEFUN ("compare-strings", Fcompare_strings, Scompare_strings, 6, 7, 0, | 212 | DEFUN ("compare-strings", Fcompare_strings, Scompare_strings, 6, 7, 0, |
| 213 | doc: /* Compare the contents of two strings, converting to multibyte if needed. | 213 | doc: /* Compare the contents of two strings, converting to multibyte if needed. |
| 214 | In string STR1, skip the first START1 characters and stop at END1. | 214 | The arguments START1, END1, START2, and END2, if non-nil, are |
| 215 | In string STR2, skip the first START2 characters and stop at END2. | 215 | positions specifying which parts of STR1 or STR2 to compare. In |
| 216 | END1 and END2 default to the full lengths of the respective strings. | 216 | string STR1, compare the part between START1 (inclusive) and END1 |
| 217 | 217 | \(exclusive). If START1 is nil, it defaults to 0, the beginning of | |
| 218 | Case is significant in this comparison if IGNORE-CASE is nil. | 218 | the string; if END1 is nil, it defaults to the length of the string. |
| 219 | Unibyte strings are converted to multibyte for comparison. | 219 | Likewise, in string STR2, compare the part between START2 and END2. |
| 220 | |||
| 221 | The strings are compared by the numeric values of their characters. | ||
| 222 | For instance, STR1 is "less than" STR2 if its first differing | ||
| 223 | character has a smaller numeric value. If IGNORE-CASE is non-nil, | ||
| 224 | characters are converted to lower-case before comparing them. Unibyte | ||
| 225 | strings are converted to multibyte for comparison. | ||
| 220 | 226 | ||
| 221 | The value is t if the strings (or specified portions) match. | 227 | The value is t if the strings (or specified portions) match. |
| 222 | If string STR1 is less, the value is a negative number N; | 228 | If string STR1 is less, the value is a negative number N; |
diff --git a/src/search.c b/src/search.c index 394012b2761..297904cbf1b 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -1313,8 +1313,11 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, | |||
| 1313 | non-nil, we can use boyer-moore search only if TRT can be | 1313 | non-nil, we can use boyer-moore search only if TRT can be |
| 1314 | represented by the byte array of 256 elements. For that, | 1314 | represented by the byte array of 256 elements. For that, |
| 1315 | all non-ASCII case-equivalents of all case-sensitive | 1315 | all non-ASCII case-equivalents of all case-sensitive |
| 1316 | characters in STRING must belong to the same charset and | 1316 | characters in STRING must belong to the same character |
| 1317 | row. */ | 1317 | group (two characters belong to the same group iff their |
| 1318 | multibyte forms are the same except for the last byte; | ||
| 1319 | i.e. every 64 characters form a group; U+0000..U+003F, | ||
| 1320 | U+0040..U+007F, U+0080..U+00BF, ...). */ | ||
| 1318 | 1321 | ||
| 1319 | while (--len >= 0) | 1322 | while (--len >= 0) |
| 1320 | { | 1323 | { |
| @@ -3644,8 +3644,7 @@ w32_add_to_cache (PSID sid, unsigned id, char *name) | |||
| 3644 | #define GID 2 | 3644 | #define GID 2 |
| 3645 | 3645 | ||
| 3646 | static int | 3646 | static int |
| 3647 | get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname, | 3647 | get_name_and_id (PSECURITY_DESCRIPTOR psd, unsigned *id, char *nm, int what) |
| 3648 | unsigned *id, char *nm, int what) | ||
| 3649 | { | 3648 | { |
| 3650 | PSID sid = NULL; | 3649 | PSID sid = NULL; |
| 3651 | char machine[MAX_COMPUTERNAME_LENGTH+1]; | 3650 | char machine[MAX_COMPUTERNAME_LENGTH+1]; |
| @@ -3655,7 +3654,6 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname, | |||
| 3655 | DWORD name_len = sizeof (name); | 3654 | DWORD name_len = sizeof (name); |
| 3656 | char domain[1024]; | 3655 | char domain[1024]; |
| 3657 | DWORD domain_len = sizeof (domain); | 3656 | DWORD domain_len = sizeof (domain); |
| 3658 | char *mp = NULL; | ||
| 3659 | int use_dflt = 0; | 3657 | int use_dflt = 0; |
| 3660 | int result; | 3658 | int result; |
| 3661 | 3659 | ||
| @@ -3670,22 +3668,7 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname, | |||
| 3670 | use_dflt = 1; | 3668 | use_dflt = 1; |
| 3671 | else if (!w32_cached_id (sid, id, nm)) | 3669 | else if (!w32_cached_id (sid, id, nm)) |
| 3672 | { | 3670 | { |
| 3673 | /* If FNAME is a UNC, we need to lookup account on the | 3671 | if (!lookup_account_sid (NULL, sid, name, &name_len, |
| 3674 | specified machine. */ | ||
| 3675 | if (IS_DIRECTORY_SEP (fname[0]) && IS_DIRECTORY_SEP (fname[1]) | ||
| 3676 | && fname[2] != '\0') | ||
| 3677 | { | ||
| 3678 | const char *s; | ||
| 3679 | char *p; | ||
| 3680 | |||
| 3681 | for (s = fname + 2, p = machine; | ||
| 3682 | *s && !IS_DIRECTORY_SEP (*s); s++, p++) | ||
| 3683 | *p = *s; | ||
| 3684 | *p = '\0'; | ||
| 3685 | mp = machine; | ||
| 3686 | } | ||
| 3687 | |||
| 3688 | if (!lookup_account_sid (mp, sid, name, &name_len, | ||
| 3689 | domain, &domain_len, &ignore) | 3672 | domain, &domain_len, &ignore) |
| 3690 | || name_len > UNLEN+1) | 3673 | || name_len > UNLEN+1) |
| 3691 | use_dflt = 1; | 3674 | use_dflt = 1; |
| @@ -3700,9 +3683,7 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname, | |||
| 3700 | } | 3683 | } |
| 3701 | 3684 | ||
| 3702 | static void | 3685 | static void |
| 3703 | get_file_owner_and_group (PSECURITY_DESCRIPTOR psd, | 3686 | get_file_owner_and_group (PSECURITY_DESCRIPTOR psd, struct stat *st) |
| 3704 | const char *fname, | ||
| 3705 | struct stat *st) | ||
| 3706 | { | 3687 | { |
| 3707 | int dflt_usr = 0, dflt_grp = 0; | 3688 | int dflt_usr = 0, dflt_grp = 0; |
| 3708 | 3689 | ||
| @@ -3713,9 +3694,9 @@ get_file_owner_and_group (PSECURITY_DESCRIPTOR psd, | |||
| 3713 | } | 3694 | } |
| 3714 | else | 3695 | else |
| 3715 | { | 3696 | { |
| 3716 | if (get_name_and_id (psd, fname, &st->st_uid, st->st_uname, UID)) | 3697 | if (get_name_and_id (psd, &st->st_uid, st->st_uname, UID)) |
| 3717 | dflt_usr = 1; | 3698 | dflt_usr = 1; |
| 3718 | if (get_name_and_id (psd, fname, &st->st_gid, st->st_gname, GID)) | 3699 | if (get_name_and_id (psd, &st->st_gid, st->st_gname, GID)) |
| 3719 | dflt_grp = 1; | 3700 | dflt_grp = 1; |
| 3720 | } | 3701 | } |
| 3721 | /* Consider files to belong to current user/group, if we cannot get | 3702 | /* Consider files to belong to current user/group, if we cannot get |
| @@ -3939,23 +3920,23 @@ stat_worker (const char * path, struct stat * buf, int follow_symlinks) | |||
| 3939 | If getting security by handle fails, and we don't need to | 3920 | If getting security by handle fails, and we don't need to |
| 3940 | resolve symlinks, we try getting security by name. */ | 3921 | resolve symlinks, we try getting security by name. */ |
| 3941 | if (!w32_stat_get_owner_group || is_windows_9x () == TRUE) | 3922 | if (!w32_stat_get_owner_group || is_windows_9x () == TRUE) |
| 3942 | get_file_owner_and_group (NULL, name, buf); | 3923 | get_file_owner_and_group (NULL, buf); |
| 3943 | else | 3924 | else |
| 3944 | { | 3925 | { |
| 3945 | psd = get_file_security_desc_by_handle (fh); | 3926 | psd = get_file_security_desc_by_handle (fh); |
| 3946 | if (psd) | 3927 | if (psd) |
| 3947 | { | 3928 | { |
| 3948 | get_file_owner_and_group (psd, name, buf); | 3929 | get_file_owner_and_group (psd, buf); |
| 3949 | LocalFree (psd); | 3930 | LocalFree (psd); |
| 3950 | } | 3931 | } |
| 3951 | else if (!(is_a_symlink && follow_symlinks)) | 3932 | else if (!(is_a_symlink && follow_symlinks)) |
| 3952 | { | 3933 | { |
| 3953 | psd = get_file_security_desc_by_name (name); | 3934 | psd = get_file_security_desc_by_name (name); |
| 3954 | get_file_owner_and_group (psd, name, buf); | 3935 | get_file_owner_and_group (psd, buf); |
| 3955 | xfree (psd); | 3936 | xfree (psd); |
| 3956 | } | 3937 | } |
| 3957 | else | 3938 | else |
| 3958 | get_file_owner_and_group (NULL, name, buf); | 3939 | get_file_owner_and_group (NULL, buf); |
| 3959 | } | 3940 | } |
| 3960 | CloseHandle (fh); | 3941 | CloseHandle (fh); |
| 3961 | } | 3942 | } |
| @@ -4064,7 +4045,7 @@ stat_worker (const char * path, struct stat * buf, int follow_symlinks) | |||
| 4064 | else | 4045 | else |
| 4065 | buf->st_mode = S_IFREG; | 4046 | buf->st_mode = S_IFREG; |
| 4066 | 4047 | ||
| 4067 | get_file_owner_and_group (NULL, name, buf); | 4048 | get_file_owner_and_group (NULL, buf); |
| 4068 | } | 4049 | } |
| 4069 | 4050 | ||
| 4070 | #if 0 | 4051 | #if 0 |
diff --git a/src/w32proc.c b/src/w32proc.c index 43ecf4d68f3..1693b2ad501 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -800,7 +800,7 @@ new_child (void) | |||
| 800 | DWORD id; | 800 | DWORD id; |
| 801 | 801 | ||
| 802 | for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) | 802 | for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) |
| 803 | if (!CHILD_ACTIVE (cp)) | 803 | if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess == NULL) |
| 804 | goto Initialize; | 804 | goto Initialize; |
| 805 | if (child_proc_count == MAX_CHILDREN) | 805 | if (child_proc_count == MAX_CHILDREN) |
| 806 | return NULL; | 806 | return NULL; |
| @@ -859,7 +859,7 @@ delete_child (child_process *cp) | |||
| 859 | if (fd_info[i].cp == cp) | 859 | if (fd_info[i].cp == cp) |
| 860 | emacs_abort (); | 860 | emacs_abort (); |
| 861 | 861 | ||
| 862 | if (!CHILD_ACTIVE (cp)) | 862 | if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess == NULL) |
| 863 | return; | 863 | return; |
| 864 | 864 | ||
| 865 | /* Delete the child's temporary input file, if any, that is pending | 865 | /* Delete the child's temporary input file, if any, that is pending |
| @@ -918,7 +918,8 @@ delete_child (child_process *cp) | |||
| 918 | if (cp == child_procs + child_proc_count - 1) | 918 | if (cp == child_procs + child_proc_count - 1) |
| 919 | { | 919 | { |
| 920 | for (i = child_proc_count-1; i >= 0; i--) | 920 | for (i = child_proc_count-1; i >= 0; i--) |
| 921 | if (CHILD_ACTIVE (&child_procs[i])) | 921 | if (CHILD_ACTIVE (&child_procs[i]) |
| 922 | || child_procs[i].procinfo.hProcess != NULL) | ||
| 922 | { | 923 | { |
| 923 | child_proc_count = i + 1; | 924 | child_proc_count = i + 1; |
| 924 | break; | 925 | break; |
| @@ -935,7 +936,8 @@ find_child_pid (DWORD pid) | |||
| 935 | child_process *cp; | 936 | child_process *cp; |
| 936 | 937 | ||
| 937 | for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) | 938 | for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) |
| 938 | if (CHILD_ACTIVE (cp) && pid == cp->pid) | 939 | if ((CHILD_ACTIVE (cp) || cp->procinfo.hProcess != NULL) |
| 940 | && pid == cp->pid) | ||
| 939 | return cp; | 941 | return cp; |
| 940 | return NULL; | 942 | return NULL; |
| 941 | } | 943 | } |