greatlrd@svn.reactos.com wrote:
The return size calculation's of GetEnvironmentVariable string was wrong. Thx to <Bizzy_D> to find out cd %windir% did not work. Now it will
Modified: trunk/reactos/lib/kernel32/misc/env.c
*Modified: trunk/reactos/lib/kernel32/misc/env.c*
--- trunk/reactos/lib/kernel32/misc/env.c 2005-07-10 22:05:48 UTC (rev 16527) +++ trunk/reactos/lib/kernel32/misc/env.c 2005-07-10 22:12:07 UTC (rev 16528) @@ -70,7 +70,7 @@
@@ -133,7 +133,7 @@
}}
- return (VarValue.Length / sizeof(WCHAR));
- return (VarValue.Length / sizeof(WCHAR) + sizeof(WCHAR));
}
Hi,
this change is wrong. The MSDN library says:
If the function succeeds, the return value is the number of TCHARs stored into the buffer pointed to by /lpBuffer/, not including the terminating null character.
Please revert your change.
- Hartmut
Hartmut Birr wrote:
Please revert your change.
- Hartmut
he already reverted the changes with his following commit after I told him.
Best Regards,
Thomas
Thomas Weidenmueller wrote:
Hartmut Birr wrote:
Please revert your change.
- Hartmut
he already reverted the changes with his following commit after I told him.
Best Regards,
Thomas
I do not mean the size mismatch. On success the function has to return the number of character not including the terminating null character. Currently, the function returns the number of character + 1.
- Hartmut
Hartmut Birr wrote:
I do not mean the size mismatch. On success the function has to return the number of character not including the terminating null character. Currently, the function returns the number of character + 1.
Oh that, i didn't check for that when I told him the changes were incorrect, I just fixed it in rev. 16536
Best Regards, Thomas
Hi Harmurt I have test the GetEnvironmentVariable it return number of chater.
Our GetEnvironmentVariable did count 1 char as zero and so on. it did miss calcutaion by 1. instead geting 9 char it did only get 8 char.
This bug was expode by reactos cmd. and we do not have any bug to getting env there, in windows. When you did type echo %windir% it did print C:\ReactO before my bug fix. it should print C:\ReactOS
Quoting Hartmut Birr hartmut.birr@gmx.de:
Thomas Weidenmueller wrote:
Hartmut Birr wrote:
Please revert your change.
- Hartmut
he already reverted the changes with his following commit after I told him.
Best Regards,
Thomas
I do not mean the size mismatch. On success the function has to return the number of character not including the terminating null character. Currently, the function returns the number of character + 1.
- Hartmut
Ros-dev mailing list Ros-dev@reactos.com http://reactos.com:8080/mailman/listinfo/ros-dev
magnus@itkonsult-olsen.com wrote:
Hi Harmurt I have test the GetEnvironmentVariable it return number of chater.
Our GetEnvironmentVariable did count 1 char as zero and so on. it did miss calcutaion by 1. instead geting 9 char it did only get 8 char.
This bug was expode by reactos cmd. and we do not have any bug to getting env there, in windows. When you did type echo %windir% it did print C:\ReactO before my bug fix. it should print C:\ReactOS
I cannot reproduce this bug. But I've found a bug in cmd.c which may eat up the last character of an environment variable.
- Hartmut
Hi W3seek have alrady fix that bug in kernel32/misc/env.c we did not handler some case right. We did have long talk on the irc yestday about this problem. with lates commit from w3seek. it can not be reprodues any more. The code change you did in cmd are making the cmd bit faster, instead for for calling reaclloc the buffer 1times it only calls when it need. But if %param% fails it must print %param% I do not know if we are doing that yet. I have not test all case yet.
Quoting Hartmut Birr hartmut.birr@gmx.de:
magnus@itkonsult-olsen.com wrote:
Hi Harmurt I have test the GetEnvironmentVariable it return number of chater.
Our GetEnvironmentVariable did count 1 char as zero and so on. it did miss calcutaion by 1. instead geting 9 char it did only get 8 char.
This bug was expode by reactos cmd. and we do not have any bug to getting env there, in windows. When you did type echo %windir% it did print C:\ReactO before my bug fix. it should
C:\ReactOS
I cannot reproduce this bug. But I've found a bug in cmd.c which may eat up the last character of an environment variable.
- Hartmut
Ros-dev mailing list Ros-dev@reactos.com http://reactos.com:8080/mailman/listinfo/ros-dev