Commit 58447bcd authored by Alexandre Julliard's avatar Alexandre Julliard

Avoid autodetecting the prefix when loading the config file since the

first key may be named 'wine'.
parent 6ebf8b49
...@@ -1391,14 +1391,14 @@ static int get_prefix_len( struct key *key, const char *name, struct file_load_i ...@@ -1391,14 +1391,14 @@ static int get_prefix_len( struct key *key, const char *name, struct file_load_i
} }
/* load all the keys from the input file */ /* load all the keys from the input file */
static void load_keys( struct key *key, FILE *f ) /* prefix_len is the number of key name prefixes to skip, or -1 for autodetection */
static void load_keys( struct key *key, FILE *f, int prefix_len )
{ {
struct key *subkey = NULL; struct key *subkey = NULL;
struct file_load_info info; struct file_load_info info;
char *p; char *p;
int default_modif = time(NULL); int default_modif = time(NULL);
int flags = (key->flags & KEY_VOLATILE) ? KEY_VOLATILE : KEY_DIRTY; int flags = (key->flags & KEY_VOLATILE) ? KEY_VOLATILE : KEY_DIRTY;
int prefix_len = -1; /* number of key name prefixes to skip */
info.file = f; info.file = f;
info.len = 4; info.len = 4;
...@@ -1465,7 +1465,7 @@ static void load_registry( struct key *key, obj_handle_t handle ) ...@@ -1465,7 +1465,7 @@ static void load_registry( struct key *key, obj_handle_t handle )
FILE *f = fdopen( fd, "r" ); FILE *f = fdopen( fd, "r" );
if (f) if (f)
{ {
load_keys( key, f ); load_keys( key, f, -1 );
fclose( f ); fclose( f );
} }
else file_set_error(); else file_set_error();
...@@ -1505,7 +1505,7 @@ void init_registry(void) ...@@ -1505,7 +1505,7 @@ void init_registry(void)
fatal_error( "could not create config key\n" ); fatal_error( "could not create config key\n" );
key->flags |= KEY_VOLATILE; key->flags |= KEY_VOLATILE;
load_keys( key, f ); load_keys( key, f, 0 );
fclose( f ); fclose( f );
if (get_error() == STATUS_NOT_REGISTRY_FILE) if (get_error() == STATUS_NOT_REGISTRY_FILE)
fatal_error( "%s is not a valid registry file\n", filename ); fatal_error( "%s is not a valid registry file\n", filename );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment