Home | Info | Community | Development | myReactOS

  1. Home
  2. Info
  3. Community
  4. Development
  5. myReactOS

  1. Main Page
  2. New
  3. Search
  4. Reports
  5. Requests

  1. Login
  2. Register

ReactOS bug tracking and reporting - Bug 2216 – mkdir bug based on wrong sub

First Last Prev Next    No search results available
Details
: mkdir bug based on wrong sub
Bug#: 2216
:
: ReactOS
: Shell
Status: RESOLVED
Resolution: FIXED
: x86 Hardware
: ReactOS
: TRUNK
: P3
: critical
: ---

:
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Heis Spiter <pierre.schweitzer@reactos.org>
Assigned To: Bug Zilla <ros-bugs@reactos.org>
: Bug Zilla <ros-bugs@reactos.org>

Attachments
Patch file (1.98 KB, patch)
2007-04-27 19:26 CET, Heis Spiter
Details
Patch file (1.98 KB, patch)
2007-04-27 19:38 CET, Heis Spiter
Details


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2007-04-27 18:12 CET
I've tried to use mkdir to create all those dirs : E:\testdir\test\pouet\.
What I got was : E:\tes & E:\testd & E:\testdir. Not what I want.

I've tried to identify the bug. I've done like that : used the same code as we
can find in internal.c and "commented and decorated it". Finally I compile it
with the same compiler (both my IDE and RosBE use the same GCC 4.1.2) but with
standard headers. And it works fine !
Then I do the same comments and decoration on internal.c to discover where was
the problem. It seems to be there : n = p - DirPath + 1; (~ line 450).

Here is the normal output (that works fine) : 
Received : E:\testdir\test\pouet\
Received : \testdir\test\pouet\
Received : testdir\test\pouet\
p : \test\pouet\
n : 11
path : E:\testdir\
Create : E:\testdir\
p : \pouet\
n : 16
path : E:\testdir\test\
Create : E:\testdir\test\
p : \
n : 22
path : E:\testdir\test\pouet\=
Create : E:\testdir\test\pouet\

Here is the wrong output of ReactOS : 
Received : E:\testdir\test\pouet\
Received : \testdir\test\pouet\
Received : testdir\test\pouet\
p : \test\pouet\
n : 4008388
path : E:\tes
Create : E:\tes
p : \pouet\
n : 4008398
path : E:\testd
Create : E:\testd
p : \
n : 4008410
path : E:\testdir\
Create : E:\testdir\

I can send code I used for my tests if you want to check.
------- Comment #1 From Heis Spiter 2007-04-27 18:49:49 CET -------
My previous display was wrong for ReactOS (I've inverted n and p...). So, in
fact it reads : 
Received : E:\testdir\test\pouet\
Received : \testdir\test\pouet\
Received : testdir\test\pouet\
p : \test\pouet\
n : 11
path : E:\tes
Create : E:\tes
p : \pouet\
n : 16
path : E:\testd
Create : E:\testd
p : \
n : 22
path : E:\testdir\
Create : E:\testdir\

So sub is right. Only memcpy can be wrong now... (not really wonderfull).
------- Comment #2 From Heis Spiter 2007-04-27 19:26:59 CET -------
Created an attachment (id=1463) [details]
Patch file

Here is a patch that fix the problem.
We get rid of memcpy and we use wcsncpy. Everything is fine.
Moreover it fixed indent in ressources.h and adds two missing strings in
fr-FR.rc
------- Comment #3 From Heis Spiter 2007-04-27 19:38:01 CET -------
Created an attachment (id=1464) [details]
Patch file

Modified patch. hpoussin said "_tcsncpy is better" and it works. So we use it !
------- Comment #4 From hpoussin 2007-04-27 19:41:35 CET -------
Committed in r26545
http://www.reactos.org/archives/public/ros-diffs/2007-April/016251.html

First Last Prev Next    No search results available