[PATCH 1 of 3] osutil: implement osutil.c for Win32

Matt Mackall mpm at selenic.com
Mon Sep 8 15:19:00 CDT 2008


On Sun, 2008-09-07 at 21:54 +0200, Patrick Mézard wrote:
> Hello Petr,
> 
> Here is a more thorough review of your latest proposal. First, you did a great job, this a valuable contribution. 
> 
> I have still many remarks, going in 3 categories:
> - Real errors: I am concerned in one place about what looks like a possible _MAX_PATH buffer overflow.
> - Style edits: try to reuse the existing coding style (NULL instead of 0, spaces, reducing indentation and so forth)

For anyone curious, the model for Mercurial's C coding style is the
Linux kernel. Among other things, that means:

- indents are tabs
- most operators have ' ' around them
- there's a ' ' between 'if' and '('
- there's a space after ','

> - Unrelated edits: your IDE or trial and errors probably caused a couple of useless changes in this patch.
> 
> I still want to investigate the execute-bit part but otherwise the patch is great.

The execute bit stuff is a bit bogus (we don't want Windows .bat files
being marked executable on UNIX anyway - it's meaningless). Also, I
think all the widechar and Unicode bits here are dead code - we're never
ever going to pass a Unicode string to osutil.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list