[netcf-devel] [PATCH 5/5] Conditionalize Windows portion

Laine Stump laine at laine.org
Thu Sep 23 17:36:00 UTC 2010


  On 09/23/2010 11:06 AM, Laine Stump wrote:
>    On 09/22/2010 04:17 PM, Eric Blake wrote:
>
>>>         if (root[strlen(root)-1] == '/') {
>>>             (*ncf)->root = strdup(root);
>> This code is skipped given your WIN32 definition of root; but your root
>> is still absolute.  Is that a problem?
>
> Actually, the intent of the entire if else (partially cut off in the
> diffs) is to append a "/" to the root string if there isn't one there.
> In Windows, that should be appending a "\" if there isn't one there. So
> I think a #define PATH_COMPONENT_SEPARATOR (or something like that) is
> in order. It can be up there with the #define ROOT.


Thinking about this some more - isn't it true that all the interface 
config for a Windows system is in the registry, not in files on disk? So 
would it make more sense for this "root" to be the root within the 
registry?(\\HKEY_LOCAL_MACHINE\something was it?) This way netcf could 
be run in a test mode that would modify settings in a scratch tree in 
the registry, rather than screwing up the actual machine config (which 
was the intent of this feature).



More information about the netcf-devel mailing list