[patch] (msvc) use more modern facilities for setenv() unsetenv()

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Sun Mar 9 15:05:06 CET 2008


Jarosław Staniek schrieb:
> For review:
> 
> - setenv(): use secure _putenv_s() declared in msvc >= 2005 (recommended 
> and apparently also used by Qt4/win); return -1 when name==0;
> 
> - unsetenv(): clear the variable using setenv(name, 0, 1) as environ is 
> deprecated.
> 
-    if (!overwrite && getenv(name)) return 0;
+    if (!overwrite && GetEnvironmentVariableA(name, dummy, 0) > 0) 
return 0;


This doesn't work in some cases - see my latest (private) mail about 
problems mixing msvcrt and winapi functions... :(

The rest looks fine - plz checkin so I can fix setenv() for use with 
libxml2 :)


Christian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/kde-windows/attachments/20080309/43435644/attachment.pgp 


More information about the Kde-windows mailing list