https://bugs.winehq.org/show_bug.cgi?id=52256
Bug ID: 52256 Summary: Current working directory reset to "/" executing a winegcc/wineg++ compiled program Product: Wine Version: 6.6 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winelib Assignee: wine-bugs@winehq.org Reporter: sacrom@gmail.com Distribution: ---
This is exactly the same bug (from the behaviour point of view) than:
https://bugs.winehq.org/show_bug.cgi?id=49545
Fixed by commit:
https://source.winehq.org/git/wine.git/commit/cdaa72c728df3c80499c8a4f59e731...)
---
It seems a "regression" between WINE 6.5 & WINE 6.6 happened.
Since Wine version 6.6 the current working directory is reset to "/" when executing a winegcc/wineg++ generated program (winelib). While in Wine 6.5 and previous versions (from 6.0 onwards) the current working directory was the directory where the command was executed from.
---
Here you can see the program, compilation and result using the latest WINE 7.0 RC2:
[sc@generic_linux1_64]/sc/tmp/wine$ wine --version wine-7.0-rc2
[sc@generic_linux1_64]/sc/tmp/wine$ cat showdir.c #include <unistd.h> #include <stdio.h>
void main(void) { char buf[256];
getcwd(buf, sizeof(buf)); fprintf(stderr, "getcwd() => %s\n", buf); }
[sc@generic_linux1_64]/sc/tmp/wine$ winegcc -o showdir_wine showdir.c
[sc@generic_linux1_64]/sc/tmp/wine$ ./showdir_wine.exe getcwd() => /
Searching for the WINE version, that introduced the difference:
WINE 6.5 WORKING ----------------
[sc@generic_linux1_64]/sc/tmp/wine$ ./showdir_wine.exe getcwd() => /sc/tmp/wine [sc@generic_linux1_64]/sc/tmp/wine$ wine --version wine-6.5
WINE 6.6 NOT WORKING --------------------
[sc@generic_linux1_64]/sc/tmp/wine$ ./showdir_wine.exe getcwd() => / [sc@generic_linux1_64]/sc/tmp/wine$ wine --version wine-6.6