aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuanma Barranquero2007-06-20 08:49:12 +0000
committerJuanma Barranquero2007-06-20 08:49:12 +0000
commit43e9fc935faa1120a5b973bbc2a021c20401e782 (patch)
treea7241011a982b5bfdaf17e7b6a0e49e6721c63d3 /src
parent5c4c911a172a714bcb745e76860738f25ab38a84 (diff)
downloademacs-43e9fc935faa1120a5b973bbc2a021c20401e782.tar.gz
emacs-43e9fc935faa1120a5b973bbc2a021c20401e782.zip
(_wsa_errlist): Fix typo in error message.
(init_environment): Ignore any environment variable from the registry having a null value.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/w32.c40
2 files changed, 25 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7de6155d427..6f1be74a8e2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12007-06-20 Juanma Barranquero <lekktu@gmail.com>
2
3 * w32.c (_wsa_errlist): Fix typo in error message.
4 (init_environment): Ignore any environment variable from the
5 registry having a null value.
6
12007-06-17 Jason Rumney <jasonr@gnu.org> 72007-06-17 Jason Rumney <jasonr@gnu.org>
2 8
3 * w32menu.c (add_menu_item): Don't use multibyte string functions on 9 * w32menu.c (add_menu_item): Don't use multibyte string functions on
diff --git a/src/w32.c b/src/w32.c
index 9ad82c7a231..4124011b451 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -113,7 +113,7 @@ extern int w32_num_mouse_buttons;
113 113
114 114
115/* 115/*
116 Initialization states 116 Initialization states
117 */ 117 */
118static BOOL g_b_init_is_windows_9x; 118static BOOL g_b_init_is_windows_9x;
119static BOOL g_b_init_open_process_token; 119static BOOL g_b_init_open_process_token;
@@ -486,20 +486,16 @@ init_user_info ()
486 the user-sid as the user id value (same for group id using the 486 the user-sid as the user id value (same for group id using the
487 primary group sid from the process token). */ 487 primary group sid from the process token). */
488 488
489 char user_sid[256], name[256], domain[256]; 489 char user_sid[256], name[256], domain[256];
490 DWORD length = sizeof (name), dlength = sizeof (domain), trash; 490 DWORD length = sizeof (name), dlength = sizeof (domain), trash;
491 HANDLE token = NULL; 491 HANDLE token = NULL;
492 SID_NAME_USE user_type; 492 SID_NAME_USE user_type;
493 493
494 if ( 494 if (open_process_token (GetCurrentProcess (), TOKEN_QUERY, &token)
495 open_process_token (GetCurrentProcess (), TOKEN_QUERY, &token) 495 && get_token_information (token, TokenUser,
496 && get_token_information ( 496 (PVOID) user_sid, sizeof (user_sid), &trash)
497 token, TokenUser, 497 && lookup_account_sid (NULL, *((PSID *) user_sid), name, &length,
498 (PVOID) user_sid, sizeof (user_sid), &trash) 498 domain, &dlength, &user_type))
499 && lookup_account_sid (
500 NULL, *((PSID *) user_sid), name, &length,
501 domain, &dlength, &user_type)
502 )
503 { 499 {
504 strcpy (the_passwd.pw_name, name); 500 strcpy (the_passwd.pw_name, name);
505 /* Determine a reasonable uid value. */ 501 /* Determine a reasonable uid value. */
@@ -524,7 +520,7 @@ init_user_info ()
524 520
525 /* Get group id */ 521 /* Get group id */
526 if (get_token_information (token, TokenPrimaryGroup, 522 if (get_token_information (token, TokenPrimaryGroup,
527 (PVOID) user_sid, sizeof (user_sid), &trash)) 523 (PVOID) user_sid, sizeof (user_sid), &trash))
528 { 524 {
529 SID_IDENTIFIER_AUTHORITY * pSIA; 525 SID_IDENTIFIER_AUTHORITY * pSIA;
530 526
@@ -541,7 +537,7 @@ init_user_info ()
541 } 537 }
542 } 538 }
543 /* If security calls are not supported (presumably because we 539 /* If security calls are not supported (presumably because we
544 are running under Windows 95), fallback to this. */ 540 are running under Windows 95), fallback to this. */
545 else if (GetUserName (name, &length)) 541 else if (GetUserName (name, &length))
546 { 542 {
547 strcpy (the_passwd.pw_name, name); 543 strcpy (the_passwd.pw_name, name);
@@ -1110,7 +1106,9 @@ init_environment (char ** argv)
1110 { 1106 {
1111 int dont_free = 0; 1107 int dont_free = 0;
1112 1108
1113 if ((lpval = w32_get_resource (env_vars[i].name, &dwType)) == NULL) 1109 if ((lpval = w32_get_resource (env_vars[i].name, &dwType)) == NULL
1110 /* Also ignore empty environment variables. */
1111 || *lpval == 0)
1114 { 1112 {
1115 lpval = env_vars[i].def_value; 1113 lpval = env_vars[i].def_value;
1116 dwType = REG_EXPAND_SZ; 1114 dwType = REG_EXPAND_SZ;
@@ -2481,7 +2479,7 @@ stat (const char * path, struct stat * buf)
2481 != INVALID_HANDLE_VALUE) 2479 != INVALID_HANDLE_VALUE)
2482 { 2480 {
2483 /* This is more accurate in terms of gettting the correct number 2481 /* This is more accurate in terms of gettting the correct number
2484 of links, but is quite slow (it is noticable when Emacs is 2482 of links, but is quite slow (it is noticeable when Emacs is
2485 making a list of file name completions). */ 2483 making a list of file name completions). */
2486 BY_HANDLE_FILE_INFORMATION info; 2484 BY_HANDLE_FILE_INFORMATION info;
2487 2485
@@ -2966,7 +2964,7 @@ struct {
2966 WSAEINVALIDPROCTABLE , "Invalid procedure table from service provider", 2964 WSAEINVALIDPROCTABLE , "Invalid procedure table from service provider",
2967 WSAEINVALIDPROVIDER , "Invalid service provider version number", 2965 WSAEINVALIDPROVIDER , "Invalid service provider version number",
2968 WSAEPROVIDERFAILEDINIT , "Unable to initialize a service provider", 2966 WSAEPROVIDERFAILEDINIT , "Unable to initialize a service provider",
2969 WSASYSCALLFAILURE , "System call failured", 2967 WSASYSCALLFAILURE , "System call failure",
2970 WSASERVICE_NOT_FOUND , "Service not found", /* not sure */ 2968 WSASERVICE_NOT_FOUND , "Service not found", /* not sure */
2971 WSATYPE_NOT_FOUND , "Class type not found", 2969 WSATYPE_NOT_FOUND , "Class type not found",
2972 WSA_E_NO_MORE , "No more resources available", /* really not sure */ 2970 WSA_E_NO_MORE , "No more resources available", /* really not sure */
@@ -4160,7 +4158,7 @@ globals_of_w32 ()
4160 SetConsoleCtrlHandler(shutdown_handler, TRUE); 4158 SetConsoleCtrlHandler(shutdown_handler, TRUE);
4161} 4159}
4162 4160
4163/* end of nt.c */ 4161/* end of w32.c */
4164 4162
4165/* arch-tag: 90442dd3-37be-482b-b272-ac752e3049f1 4163/* arch-tag: 90442dd3-37be-482b-b272-ac752e3049f1
4166 (do not change this comment) */ 4164 (do not change this comment) */