"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dlls/ntdll/unix/env.c" between
wine-5.12.tar.xz and wine-5.13.tar.xz

About: Wine is an Open Source implementation of the MS Windows API on top of X, OpenGL, and Unix. Think of Wine as a compatibility layer for running Windows programs. Development release.

env.c  (wine-5.12.tar.xz):env.c  (wine-5.13.tar.xz)
skipping to change at line 933 skipping to change at line 933
locale_string = CFStringCreateCopy( NULL, lang ); locale_string = CFStringCreateCopy( NULL, lang );
CFStringGetCString( locale_string, user_locale, sizeof(user_loca le), kCFStringEncodingUTF8 ); CFStringGetCString( locale_string, user_locale, sizeof(user_loca le), kCFStringEncodingUTF8 );
CFRelease( locale_string ); CFRelease( locale_string );
if (locale) CFRelease( locale ); if (locale) CFRelease( locale );
CFRelease( components ); CFRelease( components );
} }
} }
if (preferred_langs) CFRelease( preferred_langs ); if (preferred_langs) CFRelease( preferred_langs );
} }
#endif #endif
setlocale( LC_NUMERIC, "C" ); /* FIXME: oleaut32 depends on this */
} }
/*********************************************************************** /***********************************************************************
* init_environment * init_environment
*/ */
void init_environment( int argc, char *argv[], char *envp[] ) void init_environment( int argc, char *argv[], char *envp[] )
{ {
USHORT *case_table; USHORT *case_table;
init_unix_codepage(); init_unix_codepage();
skipping to change at line 1043 skipping to change at line 1044
env[i++] = '='; env[i++] = '=';
while (*value) env[i++] = *value++; while (*value) env[i++] = *value++;
} }
env[i++] = 0; env[i++] = 0;
*pos = i; *pos = i;
} }
/* set an environment variable for one of the wine path variables */ /* set an environment variable for one of the wine path variables */
static void add_path_var( WCHAR *env, SIZE_T *pos, const char *name, const char *path ) static void add_path_var( WCHAR *env, SIZE_T *pos, const char *name, const char *path )
{ {
UNICODE_STRING nt_name; WCHAR *nt_name;
ANSI_STRING unix_name;
if (!path) append_envW( env, pos, name, NULL ); if (!path) append_envW( env, pos, name, NULL );
else else
{ {
RtlInitAnsiString( &unix_name, path ); if (unix_to_nt_file_name( path, &nt_name )) return;
if (unix_to_nt_file_name( &unix_name, &nt_name )) return; append_envW( env, pos, name, nt_name );
append_envW( env, pos, name, nt_name.Buffer ); free( nt_name );
RtlFreeUnicodeString( &nt_name );
} }
} }
/************************************************************************* /*************************************************************************
* get_startup_info * get_startup_info
* *
* Get the startup information from the server. * Get the startup information from the server.
*/ */
NTSTATUS CDECL get_startup_info( startup_info_t *info, SIZE_T *total_size, SIZE_ T *info_size ) NTSTATUS CDECL get_startup_info( startup_info_t *info, SIZE_T *total_size, SIZE_ T *info_size )
{ {
skipping to change at line 1184 skipping to change at line 1183
{ {
struct stat st1, st2; struct stat st1, st2;
if (!pwd || stat( pwd, &st1 ) == -1 || if (!pwd || stat( pwd, &st1 ) == -1 ||
(!stat( cwd, &st2 ) && (st1.st_dev != st2.st_dev || st1.st_ino != st 2.st_ino))) (!stat( cwd, &st2 ) && (st1.st_dev != st2.st_dev || st1.st_ino != st 2.st_ino)))
pwd = cwd; pwd = cwd;
} }
if (pwd) if (pwd)
{ {
ANSI_STRING unix_name; WCHAR *nt_name;
UNICODE_STRING nt_name;
RtlInitAnsiString( &unix_name, pwd ); if (!unix_to_nt_file_name( pwd, &nt_name ))
if (!unix_to_nt_file_name( &unix_name, &nt_name ))
{ {
/* skip the \??\ prefix */ /* skip the \??\ prefix */
if (nt_name.Length > 6 * sizeof(WCHAR) && nt_name.Buffer[5] == ':') ULONG len = wcslen( nt_name );
if (len > 6 && nt_name[5] == ':')
{ {
dir->Length = nt_name.Length - 4 * sizeof(WCHAR); dir->Length = (len - 4) * sizeof(WCHAR);
memcpy( dir->Buffer, nt_name.Buffer + 4, dir->Length ); memcpy( dir->Buffer, nt_name + 4, dir->Length );
} }
else /* change \??\ to \\?\ */ else /* change \??\ to \\?\ */
{ {
dir->Length = nt_name.Length; dir->Length = len * sizeof(WCHAR);
memcpy( dir->Buffer, nt_name.Buffer, dir->Length ); memcpy( dir->Buffer, nt_name, dir->Length );
dir->Buffer[1] = '\\'; dir->Buffer[1] = '\\';
} }
RtlFreeUnicodeString( &nt_name ); free( nt_name );
} }
} }
if (!dir->Length) /* still not initialized */ if (!dir->Length) /* still not initialized */
MESSAGE("Warning: could not find DOS drive for current working directory '%s', " MESSAGE("Warning: could not find DOS drive for current working directory '%s', "
"starting in the Windows directory.\n", cwd ? cwd : "" ); "starting in the Windows directory.\n", cwd ? cwd : "" );
free( cwd ); free( cwd );
chdir( "/" ); /* avoid locking removable devices */ chdir( "/" ); /* avoid locking removable devices */
} }
 End of changes. 9 change blocks. 
16 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)