Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6f123e84
Commit
6f123e84
authored
Jan 16, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: Always fall back to argv[0] to find the tools directory.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54319
parent
5ca22f55
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
20 deletions
+8
-20
widl.c
tools/widl/widl.c
+2
-4
winegcc.c
tools/winegcc/winegcc.c
+2
-4
wmc.c
tools/wmc/wmc.c
+2
-6
wrc.c
tools/wrc/wrc.c
+2
-6
No files found.
tools/widl/widl.c
View file @
6f123e84
...
@@ -483,7 +483,7 @@ void write_id_data(const statement_list_t *stmts)
...
@@ -483,7 +483,7 @@ void write_id_data(const statement_list_t *stmts)
static
void
init_argv0_dir
(
const
char
*
argv0
)
static
void
init_argv0_dir
(
const
char
*
argv0
)
{
{
#ifndef _WIN32
#ifndef _WIN32
char
*
dir
;
char
*
dir
=
NULL
;
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
dir
=
realpath
(
"/proc/self/exe"
,
NULL
);
dir
=
realpath
(
"/proc/self/exe"
,
NULL
);
...
@@ -494,10 +494,8 @@ static void init_argv0_dir( const char *argv0 )
...
@@ -494,10 +494,8 @@ static void init_argv0_dir( const char *argv0 )
if
(
!
sysctl
(
pathname
,
ARRAY_SIZE
(
pathname
),
path
,
&
path_size
,
NULL
,
0
))
if
(
!
sysctl
(
pathname
,
ARRAY_SIZE
(
pathname
),
path
,
&
path_size
,
NULL
,
0
))
dir
=
realpath
(
path
,
NULL
);
dir
=
realpath
(
path
,
NULL
);
free
(
path
);
free
(
path
);
#else
dir
=
realpath
(
argv0
,
NULL
);
#endif
#endif
if
(
!
dir
)
return
;
if
(
!
dir
&&
!
(
dir
=
realpath
(
argv0
,
NULL
))
)
return
;
includedir
=
strmake
(
"%s/%s"
,
get_dirname
(
dir
),
BIN_TO_INCLUDEDIR
);
includedir
=
strmake
(
"%s/%s"
,
get_dirname
(
dir
),
BIN_TO_INCLUDEDIR
);
dlldir
=
strmake
(
"%s/%s"
,
get_dirname
(
dir
),
BIN_TO_DLLDIR
);
dlldir
=
strmake
(
"%s/%s"
,
get_dirname
(
dir
),
BIN_TO_DLLDIR
);
#endif
#endif
...
...
tools/winegcc/winegcc.c
View file @
6f123e84
...
@@ -647,7 +647,7 @@ static char *get_lib_dir( struct options *opts )
...
@@ -647,7 +647,7 @@ static char *get_lib_dir( struct options *opts )
static
void
init_argv0_dir
(
const
char
*
argv0
)
static
void
init_argv0_dir
(
const
char
*
argv0
)
{
{
#ifndef _WIN32
#ifndef _WIN32
char
*
dir
;
char
*
dir
=
NULL
;
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
dir
=
realpath
(
"/proc/self/exe"
,
NULL
);
dir
=
realpath
(
"/proc/self/exe"
,
NULL
);
...
@@ -658,10 +658,8 @@ static void init_argv0_dir( const char *argv0 )
...
@@ -658,10 +658,8 @@ static void init_argv0_dir( const char *argv0 )
if
(
!
sysctl
(
pathname
,
ARRAY_SIZE
(
pathname
),
path
,
&
path_size
,
NULL
,
0
))
if
(
!
sysctl
(
pathname
,
ARRAY_SIZE
(
pathname
),
path
,
&
path_size
,
NULL
,
0
))
dir
=
realpath
(
path
,
NULL
);
dir
=
realpath
(
path
,
NULL
);
free
(
path
);
free
(
path
);
#else
dir
=
realpath
(
argv0
,
NULL
);
#endif
#endif
if
(
!
dir
)
return
;
if
(
!
dir
&&
!
(
dir
=
realpath
(
argv0
,
NULL
))
)
return
;
bindir
=
get_dirname
(
dir
);
bindir
=
get_dirname
(
dir
);
includedir
=
strmake
(
"%s/%s"
,
bindir
,
BIN_TO_INCLUDEDIR
);
includedir
=
strmake
(
"%s/%s"
,
bindir
,
BIN_TO_INCLUDEDIR
);
libdir
=
strmake
(
"%s/%s"
,
bindir
,
BIN_TO_LIBDIR
);
libdir
=
strmake
(
"%s/%s"
,
bindir
,
BIN_TO_LIBDIR
);
...
...
tools/wmc/wmc.c
View file @
6f123e84
...
@@ -150,7 +150,7 @@ static void exit_on_signal( int sig )
...
@@ -150,7 +150,7 @@ static void exit_on_signal( int sig )
static
void
init_argv0_dir
(
const
char
*
argv0
)
static
void
init_argv0_dir
(
const
char
*
argv0
)
{
{
#ifndef _WIN32
#ifndef _WIN32
char
*
dir
;
char
*
dir
=
NULL
;
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
dir
=
realpath
(
"/proc/self/exe"
,
NULL
);
dir
=
realpath
(
"/proc/self/exe"
,
NULL
);
...
@@ -160,13 +160,9 @@ static void init_argv0_dir( const char *argv0 )
...
@@ -160,13 +160,9 @@ static void init_argv0_dir( const char *argv0 )
char
*
path
=
xmalloc
(
path_size
);
char
*
path
=
xmalloc
(
path_size
);
if
(
!
sysctl
(
pathname
,
ARRAY_SIZE
(
pathname
),
path
,
&
path_size
,
NULL
,
0
))
if
(
!
sysctl
(
pathname
,
ARRAY_SIZE
(
pathname
),
path
,
&
path_size
,
NULL
,
0
))
dir
=
realpath
(
path
,
NULL
);
dir
=
realpath
(
path
,
NULL
);
else
dir
=
NULL
;
free
(
path
);
free
(
path
);
#else
dir
=
realpath
(
argv0
,
NULL
);
#endif
#endif
if
(
!
dir
)
return
;
if
(
!
dir
&&
!
(
dir
=
realpath
(
argv0
,
NULL
))
)
return
;
dir
=
get_dirname
(
dir
);
dir
=
get_dirname
(
dir
);
if
(
strendswith
(
dir
,
"/tools/wmc"
))
nlsdirs
[
0
]
=
strmake
(
"%s/../../nls"
,
dir
);
if
(
strendswith
(
dir
,
"/tools/wmc"
))
nlsdirs
[
0
]
=
strmake
(
"%s/../../nls"
,
dir
);
else
nlsdirs
[
0
]
=
strmake
(
"%s/%s"
,
dir
,
BIN_TO_NLSDIR
);
else
nlsdirs
[
0
]
=
strmake
(
"%s/%s"
,
dir
,
BIN_TO_NLSDIR
);
...
...
tools/wrc/wrc.c
View file @
6f123e84
...
@@ -295,7 +295,7 @@ static int load_file( const char *input_name, const char *output_name )
...
@@ -295,7 +295,7 @@ static int load_file( const char *input_name, const char *output_name )
static
void
init_argv0_dir
(
const
char
*
argv0
)
static
void
init_argv0_dir
(
const
char
*
argv0
)
{
{
#ifndef _WIN32
#ifndef _WIN32
char
*
dir
;
char
*
dir
=
NULL
;
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
dir
=
realpath
(
"/proc/self/exe"
,
NULL
);
dir
=
realpath
(
"/proc/self/exe"
,
NULL
);
...
@@ -305,13 +305,9 @@ static void init_argv0_dir( const char *argv0 )
...
@@ -305,13 +305,9 @@ static void init_argv0_dir( const char *argv0 )
char
*
path
=
xmalloc
(
path_size
);
char
*
path
=
xmalloc
(
path_size
);
if
(
!
sysctl
(
pathname
,
ARRAY_SIZE
(
pathname
),
path
,
&
path_size
,
NULL
,
0
))
if
(
!
sysctl
(
pathname
,
ARRAY_SIZE
(
pathname
),
path
,
&
path_size
,
NULL
,
0
))
dir
=
realpath
(
path
,
NULL
);
dir
=
realpath
(
path
,
NULL
);
else
dir
=
NULL
;
free
(
path
);
free
(
path
);
#else
dir
=
realpath
(
argv0
,
NULL
);
#endif
#endif
if
(
!
dir
)
return
;
if
(
!
dir
&&
!
(
dir
=
realpath
(
argv0
,
NULL
))
)
return
;
dir
=
get_dirname
(
dir
);
dir
=
get_dirname
(
dir
);
includedir
=
strmake
(
"%s/%s"
,
dir
,
BIN_TO_INCLUDEDIR
);
includedir
=
strmake
(
"%s/%s"
,
dir
,
BIN_TO_INCLUDEDIR
);
if
(
strendswith
(
dir
,
"/tools/wrc"
))
nlsdirs
[
0
]
=
strmake
(
"%s/../../nls"
,
dir
);
if
(
strendswith
(
dir
,
"/tools/wrc"
))
nlsdirs
[
0
]
=
strmake
(
"%s/../../nls"
,
dir
);
...
...
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