diff options
| author | Glenn Morris | 2012-11-20 20:47:55 -0800 |
|---|---|---|
| committer | Glenn Morris | 2012-11-20 20:47:55 -0800 |
| commit | 6ef2e5ef5278a807132b78c42de402925b20bfb3 (patch) | |
| tree | e5711cdfcdf8a152416c2a96e399695285a4a3a8 /src | |
| parent | eadf1faa3cb5eea8c25a5166a9a97ebd63525c56 (diff) | |
| parent | b6729a180f4b81ac26bd7b61f5330643b2d5e994 (diff) | |
| download | emacs-6ef2e5ef5278a807132b78c42de402925b20bfb3.tar.gz emacs-6ef2e5ef5278a807132b78c42de402925b20bfb3.zip | |
Merge from emacs-24; up to 2012-11-17T22:12:47Z!eggert@cs.ucla.edu
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 21 | ||||
| -rw-r--r-- | src/emacs.c | 2 | ||||
| -rw-r--r-- | src/fileio.c | 46 | ||||
| -rw-r--r-- | src/w32.c | 13 | ||||
| -rw-r--r-- | src/w32term.h | 2 |
5 files changed, 70 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 332656fcf00..c16a4dc87ce 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,24 @@ | |||
| 1 | 2012-11-21 Ken Brown <kbrown@cornell.edu> | ||
| 2 | |||
| 3 | * emacs.c (main): Set the G_SLICE environment variable for all | ||
| 4 | Cygwin builds, not just GTK builds. See | ||
| 5 | https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html. | ||
| 6 | |||
| 7 | 2012-11-21 Eli Zaretskii <eliz@gnu.org> | ||
| 8 | |||
| 9 | * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED) | ||
| 10 | (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]: | ||
| 11 | Define for the MSVC compiler. | ||
| 12 | |||
| 13 | * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon. | ||
| 14 | |||
| 15 | * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory) | ||
| 16 | (Fexpand_file_name) [DOS_NT]: Pass encoded file name to | ||
| 17 | dostounix_filename. Prevents crashes down the road, because | ||
| 18 | dostounix_filename assumes it gets a unibyte string. Reported by | ||
| 19 | Michel de Ruiter <michel@sentient.nl>, see | ||
| 20 | http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html | ||
| 21 | |||
| 1 | 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca> | 22 | 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 23 | ||
| 3 | Conflate Qnil and Qunbound for `symbol-function'. | 24 | Conflate Qnil and Qunbound for `symbol-function'. |
diff --git a/src/emacs.c b/src/emacs.c index d69dbfda7bf..b2b193e3a4f 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -715,7 +715,7 @@ main (int argc, char **argv) | |||
| 715 | stack_base = &dummy; | 715 | stack_base = &dummy; |
| 716 | #endif | 716 | #endif |
| 717 | 717 | ||
| 718 | #if defined (USE_GTK) && defined (G_SLICE_ALWAYS_MALLOC) | 718 | #ifdef G_SLICE_ALWAYS_MALLOC |
| 719 | /* This is used by the Cygwin build. */ | 719 | /* This is used by the Cygwin build. */ |
| 720 | setenv ("G_SLICE", "always-malloc", 1); | 720 | setenv ("G_SLICE", "always-malloc", 1); |
| 721 | #endif | 721 | #endif |
diff --git a/src/fileio.c b/src/fileio.c index 572f6d8ef83..e1a7cf55e28 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -315,6 +315,7 @@ Given a Unix syntax file name, returns a string ending in slash. */) | |||
| 315 | register const char *beg; | 315 | register const char *beg; |
| 316 | #else | 316 | #else |
| 317 | register char *beg; | 317 | register char *beg; |
| 318 | Lisp_Object tem_fn; | ||
| 318 | #endif | 319 | #endif |
| 319 | register const char *p; | 320 | register const char *p; |
| 320 | Lisp_Object handler; | 321 | Lisp_Object handler; |
| @@ -374,10 +375,13 @@ Given a Unix syntax file name, returns a string ending in slash. */) | |||
| 374 | p = beg + strlen (beg); | 375 | p = beg + strlen (beg); |
| 375 | } | 376 | } |
| 376 | } | 377 | } |
| 377 | dostounix_filename (beg); | 378 | tem_fn = ENCODE_FILE (make_specified_string (beg, -1, p - beg, |
| 378 | #endif /* DOS_NT */ | 379 | STRING_MULTIBYTE (filename))); |
| 379 | 380 | dostounix_filename (SSDATA (tem_fn)); | |
| 381 | return DECODE_FILE (tem_fn); | ||
| 382 | #else /* DOS_NT */ | ||
| 380 | return make_specified_string (beg, -1, p - beg, STRING_MULTIBYTE (filename)); | 383 | return make_specified_string (beg, -1, p - beg, STRING_MULTIBYTE (filename)); |
| 384 | #endif /* DOS_NT */ | ||
| 381 | } | 385 | } |
| 382 | 386 | ||
| 383 | DEFUN ("file-name-nondirectory", Ffile_name_nondirectory, | 387 | DEFUN ("file-name-nondirectory", Ffile_name_nondirectory, |
| @@ -951,7 +955,18 @@ filesystem tree, not (expand-file-name ".." dirname). */) | |||
| 951 | #ifdef DOS_NT | 955 | #ifdef DOS_NT |
| 952 | /* Make sure directories are all separated with /, but | 956 | /* Make sure directories are all separated with /, but |
| 953 | avoid allocation of a new string when not required. */ | 957 | avoid allocation of a new string when not required. */ |
| 954 | dostounix_filename (nm); | 958 | if (multibyte) |
| 959 | { | ||
| 960 | Lisp_Object tem_name = make_specified_string (nm, -1, strlen (nm), | ||
| 961 | multibyte); | ||
| 962 | |||
| 963 | tem_name = ENCODE_FILE (tem_name); | ||
| 964 | dostounix_filename (SSDATA (tem_name)); | ||
| 965 | tem_name = DECODE_FILE (tem_name); | ||
| 966 | memcpy (nm, SSDATA (tem_name), SBYTES (tem_name) + 1); | ||
| 967 | } | ||
| 968 | else | ||
| 969 | dostounix_filename (nm); | ||
| 955 | #ifdef WINDOWSNT | 970 | #ifdef WINDOWSNT |
| 956 | if (IS_DIRECTORY_SEP (nm[1])) | 971 | if (IS_DIRECTORY_SEP (nm[1])) |
| 957 | { | 972 | { |
| @@ -1305,10 +1320,13 @@ filesystem tree, not (expand-file-name ".." dirname). */) | |||
| 1305 | target[0] = '/'; | 1320 | target[0] = '/'; |
| 1306 | target[1] = ':'; | 1321 | target[1] = ':'; |
| 1307 | } | 1322 | } |
| 1308 | dostounix_filename (target); | ||
| 1309 | #endif /* DOS_NT */ | ||
| 1310 | |||
| 1311 | result = make_specified_string (target, -1, o - target, multibyte); | 1323 | result = make_specified_string (target, -1, o - target, multibyte); |
| 1324 | result = ENCODE_FILE (result); | ||
| 1325 | dostounix_filename (SSDATA (result)); | ||
| 1326 | result = DECODE_FILE (result); | ||
| 1327 | #else /* !DOS_NT */ | ||
| 1328 | result = make_specified_string (target, -1, o - target, multibyte); | ||
| 1329 | #endif /* !DOS_NT */ | ||
| 1312 | } | 1330 | } |
| 1313 | 1331 | ||
| 1314 | /* Again look to see if the file name has special constructs in it | 1332 | /* Again look to see if the file name has special constructs in it |
| @@ -1587,8 +1605,18 @@ those `/' is discarded. */) | |||
| 1587 | memcpy (nm, SDATA (filename), SBYTES (filename) + 1); | 1605 | memcpy (nm, SDATA (filename), SBYTES (filename) + 1); |
| 1588 | 1606 | ||
| 1589 | #ifdef DOS_NT | 1607 | #ifdef DOS_NT |
| 1590 | dostounix_filename (nm); | 1608 | { |
| 1591 | substituted = (strcmp (nm, SDATA (filename)) != 0); | 1609 | Lisp_Object encoded_filename = ENCODE_FILE (filename); |
| 1610 | Lisp_Object tem_fn; | ||
| 1611 | |||
| 1612 | dostounix_filename (SDATA (encoded_filename)); | ||
| 1613 | tem_fn = DECODE_FILE (encoded_filename); | ||
| 1614 | nm = alloca (SBYTES (tem_fn) + 1); | ||
| 1615 | memcpy (nm, SDATA (tem_fn), SBYTES (tem_fn) + 1); | ||
| 1616 | substituted = (memcmp (nm, SDATA (filename), SBYTES (filename)) != 0); | ||
| 1617 | if (substituted) | ||
| 1618 | filename = tem_fn; | ||
| 1619 | } | ||
| 1592 | #endif | 1620 | #endif |
| 1593 | endp = nm + SBYTES (filename); | 1621 | endp = nm + SBYTES (filename); |
| 1594 | 1622 | ||
| @@ -119,9 +119,10 @@ typedef struct _PROCESS_MEMORY_COUNTERS_EX { | |||
| 119 | #include <aclapi.h> | 119 | #include <aclapi.h> |
| 120 | 120 | ||
| 121 | #ifdef _MSC_VER | 121 | #ifdef _MSC_VER |
| 122 | /* MSVC doesn't provide the definition of REPARSE_DATA_BUFFER, except | 122 | /* MSVC doesn't provide the definition of REPARSE_DATA_BUFFER and the |
| 123 | on ntifs.h, which cannot be included because it triggers conflicts | 123 | associated macros, except on ntifs.h, which cannot be included |
| 124 | with other Windows API headers. So we define it here by hand. */ | 124 | because it triggers conflicts with other Windows API headers. So |
| 125 | we define it here by hand. */ | ||
| 125 | 126 | ||
| 126 | typedef struct _REPARSE_DATA_BUFFER { | 127 | typedef struct _REPARSE_DATA_BUFFER { |
| 127 | ULONG ReparseTag; | 128 | ULONG ReparseTag; |
| @@ -149,6 +150,12 @@ typedef struct _REPARSE_DATA_BUFFER { | |||
| 149 | } DUMMYUNIONNAME; | 150 | } DUMMYUNIONNAME; |
| 150 | } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; | 151 | } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; |
| 151 | 152 | ||
| 153 | #define FILE_DEVICE_FILE_SYSTEM 9 | ||
| 154 | #define METHOD_BUFFERED 0 | ||
| 155 | #define FILE_ANY_ACCESS 0x00000000 | ||
| 156 | #define CTL_CODE(t,f,m,a) (((t)<<16)|((a)<<14)|((f)<<2)|(m)) | ||
| 157 | #define FSCTL_GET_REPARSE_POINT \ | ||
| 158 | CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) | ||
| 152 | #endif | 159 | #endif |
| 153 | 160 | ||
| 154 | /* TCP connection support. */ | 161 | /* TCP connection support. */ |
diff --git a/src/w32term.h b/src/w32term.h index 83535b8faa3..ce709c1231d 100644 --- a/src/w32term.h +++ b/src/w32term.h | |||
| @@ -751,7 +751,7 @@ extern int w32_system_caret_y; | |||
| 751 | typedef BOOL (CALLBACK *LOCALE_ENUMPROCA)(LPSTR); | 751 | typedef BOOL (CALLBACK *LOCALE_ENUMPROCA)(LPSTR); |
| 752 | typedef BOOL (CALLBACK *LOCALE_ENUMPROCW)(LPWSTR); | 752 | typedef BOOL (CALLBACK *LOCALE_ENUMPROCW)(LPWSTR); |
| 753 | BOOL WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA,DWORD); | 753 | BOOL WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA,DWORD); |
| 754 | BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW,DWORD) | 754 | BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW,DWORD); |
| 755 | #ifdef UNICODE | 755 | #ifdef UNICODE |
| 756 | #define EnumSystemLocales EnumSystemLocalesW | 756 | #define EnumSystemLocales EnumSystemLocalesW |
| 757 | #else | 757 | #else |