[Bug 52256] New: Current working directory reset to "/" executing a winegcc/wineg++ compiled program

WineHQ Bugzilla wine-bugs at winehq.org
Wed Dec 22 11:07:18 CST 2021


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 at winehq.org
          Reporter: sacrom at 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/cdaa72c728df3c80499c8a4f59e731f353347db0)

---

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 at generic_linux1_64]/sc/tmp/wine$ wine --version
wine-7.0-rc2

[sc at 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 at generic_linux1_64]/sc/tmp/wine$ winegcc -o showdir_wine showdir.c

[sc at generic_linux1_64]/sc/tmp/wine$ ./showdir_wine.exe
getcwd() => /


Searching for the WINE version, that introduced the difference:

WINE 6.5 WORKING
----------------

[sc at generic_linux1_64]/sc/tmp/wine$ ./showdir_wine.exe
getcwd() => /sc/tmp/wine
[sc at generic_linux1_64]/sc/tmp/wine$ wine --version
wine-6.5

WINE 6.6 NOT WORKING
--------------------

[sc at generic_linux1_64]/sc/tmp/wine$ ./showdir_wine.exe
getcwd() => /
[sc at generic_linux1_64]/sc/tmp/wine$ wine --version
wine-6.6

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list