Hi Larisa,
sorry for replying so late and thanks for the patch.

2012/4/14 grigore larisa <[email protected]>:
> Hi,
>
> I attached the patch that removes the usage of strtok from mkdir comment
> from bdsh. Any reviews are welcome.
First of all, your patch does not conform with our coding style.
Although it may look as a triviality for such small patch, it means
that the reviewer would have to spend extra time correcting these
before it would be possible to actually use the patch in mainline. A
minor thing is that the name word_index is bad. It is not index of
words but rather index of directories and the name shall reflect that.

Next, you iterate over the string without decoding any of the
characters. The string is in UTF-8 and to iterate this way (i.e. over
single bytes) is not considered safe. You shall use str_decode().
Actually, this problem would be bypassed if you would use already
existing functions for searching in a string, such as str_chr.

And it seems to me that some of the conditions are there only to
handle situations when the path is not canonified. If you would use
absolutize() first, the code would be probably simpler. And another
ToDo would be implemented "just by the way".

During the review process I fixed some other issues in mkdir and
finally ended in rewriting the create_directory() function altogether
(so far, it is in my "misc" branch). Thus, in the end it was not
possible to use your patch. Sorry.

Once more, thanks for the patch.

- Vojta

>
> Larisa
>
>
>
>
> _______________________________________________
> HelenOS-devel mailing list
> [email protected]
> http://lists.modry.cz/cgi-bin/listinfo/helenos-devel
>

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel

Reply via email to