Skip to content

Commit 076592c

Browse files
authored
Merge pull request #188 from bbannier/topic/bbannier/getcwd-with-NULL-buf
Avoid GNU `getcwd` extension behavior
2 parents 157feb3 + 99c3500 commit 076592c

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

.cirrus.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,24 @@ freebsd_task:
1111
test_script: |
1212
sudo -u testuser .ci/unix-test.sh
1313
14-
centos7_task:
14+
rockylinux8_task:
1515
container:
16-
image: centos:7
16+
image: docker.io/rockylinux:8
1717
install_script: |
18-
yum install -y centos-release-scl
19-
yum install -y devtoolset-9
20-
curl -L https://github.com/Kitware/CMake/releases/download/v3.16.4/cmake-3.16.4-Linux-x86_64.tar.gz | tar xzvf - -C /usr/local --strip-components 1
18+
dnf group install -y "Development Tools"
19+
dnf install cmake -y
2120
build_script: |
22-
source /opt/rh/devtoolset-9/enable && PATH=$PATH:/usr/local/bin .ci/unix-build.sh
21+
.ci/unix-build.sh
2322
test_script: |
24-
PATH=$PATH:/usr/local/bin .ci/unix-test.sh
23+
.ci/unix-test.sh
2524
26-
centos8_task:
25+
rockylinux9_task:
2726
container:
28-
image: quay.io/centos/centos:stream8
27+
image: docker.io/rockylinux:9
2928
install_script: |
30-
yum group install -y "Development Tools"
31-
curl -L https://github.com/Kitware/CMake/releases/download/v3.16.4/cmake-3.16.4-Linux-x86_64.tar.gz | tar xzvf - -C /usr/local --strip-components 1
29+
dnf group install -y "Development Tools"
30+
dnf install cmake -y
3231
build_script: |
33-
PATH=$PATH:/usr/local/bin .ci/unix-build.sh
32+
.ci/unix-build.sh
3433
test_script: |
35-
PATH=$PATH:/usr/local/bin .ci/unix-test.sh
34+
.ci/unix-test.sh

include/ghc/filesystem.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4229,7 +4229,7 @@ GHC_INLINE path current_path(std::error_code& ec)
42294229
}
42304230
return path(std::wstring(buffer.get()), path::native_format);
42314231
#elif defined(__GLIBC__)
4232-
std::unique_ptr<char, decltype(&std::free)> buffer { ::getcwd(NULL, 0), std::free };
4232+
std::unique_ptr<char, decltype(&std::free)> buffer { ::get_current_dir_name(), std::free };
42334233
if (buffer == nullptr) {
42344234
ec = detail::make_system_error();
42354235
return path();

0 commit comments

Comments
 (0)