Author: fireball
Date: Fri Oct 12 13:58:00 2007
New Revision: 29531
URL:
http://svn.reactos.org/svn/reactos?rev=29531&view=rev
Log:
Johannes Anderwald
- Fix the msvcrt exception (because vlc first calls _getmainargs. This function sets the
__argc to 1. Afterwards vlc calls again __wgetmainargs where __argc is now one. When
entering the function _wadd, it doesnot allocate the __wargv because __argc is 1.
Therefore it crashes).
See issue #821 for more details.
Modified:
trunk/reactos/lib/sdk/crt/misc/crtmain.c (props changed)
trunk/reactos/lib/sdk/crt/misc/getargs.c (contents, props changed)
Propchange: trunk/reactos/lib/sdk/crt/misc/crtmain.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Modified: trunk/reactos/lib/sdk/crt/misc/getargs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/misc/getargs.c…
==============================================================================
--- trunk/reactos/lib/sdk/crt/misc/getargs.c (original)
+++ trunk/reactos/lib/sdk/crt/misc/getargs.c Fri Oct 12 13:58:00 2007
@@ -192,7 +192,18 @@
ignorespace = 0;
doexpand = expand_wildcards;
+ if (__argv && _environ)
+ {
+ *argv = __argv;
+ *env = _environ;
+ *argc = __argc;
+ return;
+ }
+
+ __argc = 0;
+
len = strlen(_acmdln);
+
while (_acmdln[i])
{
@@ -262,6 +273,16 @@
ignorespace = 0;
doexpand = expand_wildcards;
+ if (__wargv && __winitenv)
+ {
+ *wargv = __wargv;
+ *wenv = __winitenv;
+ *argc = __argc;
+ return;
+ }
+
+ __argc = 0;
+
len = wcslen(_wcmdln);
while (_wcmdln[i])
Propchange: trunk/reactos/lib/sdk/crt/misc/getargs.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*