Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b43b9d93
Commit
b43b9d93
authored
Apr 14, 2000
by
Ove Kaaven
Committed by
Alexandre Julliard
Apr 14, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow symlinks when saving registry.
parent
9639a0a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
registry.c
misc/registry.c
+19
-4
No files found.
misc/registry.c
View file @
b43b9d93
...
...
@@ -25,6 +25,7 @@
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <limits.h>
#include <ctype.h>
#include <errno.h>
#ifdef HAVE_SYS_ERRNO_H
...
...
@@ -186,10 +187,23 @@ static void save_key( HKEY hkey, const char *filename )
DWORD
ret
;
HANDLE
handle
;
char
*
p
;
char
*
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
filename
)
+
20
);
char
*
rname
=
HeapAlloc
(
GetProcessHeap
(),
0
,
PATH_MAX
);
char
*
name
;
/* use realpath to resolve any symlinks
* I assume that rname is filled in correctly if the error is ENOENT */
if
((
realpath
(
filename
,
rname
)
==
NULL
)
&&
(
errno
!=
ENOENT
))
{
ERR
(
"Failed to find real path of %s: "
,
filename
);
perror
(
"realpath"
);
HeapFree
(
GetProcessHeap
(),
0
,
rname
);
return
;
}
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
rname
)
+
20
);
if
(
!
name
)
return
;
strcpy
(
name
,
file
name
);
strcpy
(
name
,
r
name
);
if
((
p
=
strrchr
(
name
,
'/'
)))
p
++
;
else
p
=
name
;
...
...
@@ -209,15 +223,16 @@ static void save_key( HKEY hkey, const char *filename )
ret
=
server_call_noerr
(
REQ_SAVE_REGISTRY
);
CloseHandle
(
handle
);
if
(
ret
)
unlink
(
name
);
else
if
(
rename
(
name
,
file
name
)
==
-
1
)
else
if
(
rename
(
name
,
r
name
)
==
-
1
)
{
ERR
(
"Failed to move %s to %s: "
,
name
,
file
name
);
ERR
(
"Failed to move %s to %s: "
,
name
,
r
name
);
perror
(
"rename"
);
unlink
(
name
);
}
}
else
ERR
(
"Failed to save registry to %s, err %ld
\n
"
,
name
,
GetLastError
()
);
HeapFree
(
GetProcessHeap
(),
0
,
rname
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment