From ac5f011f57a85a38627af154bc3ee7580e7fecd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Mon, 18 Apr 2016 10:45:12 +0200 Subject: [PATCH] getcwd: fix too long pathnames bug --- CHANGELOG | 5 ++++- src/c/unixfsys.d | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5ee267613..6160ceff0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -37,9 +37,12 @@ section "Removed interfaces". ** Issues fixed - MOP: fix problemes when redefining non-standard and anonymous classes - Bugs identified and fixed by Pascal Costanza. +- getcwd: fix issue with too long pathname +This fixes the regression, which crashed ECL at start when pathname +exceeded 128 characters limit. + * 16.1.2 changes since 16.0.0 ** API changes diff --git a/src/c/unixfsys.d b/src/c/unixfsys.d index d3dd4d10e..287eded04 100644 --- a/src/c/unixfsys.d +++ b/src/c/unixfsys.d @@ -158,7 +158,7 @@ current_dir(void) { output = ecl_alloc_adjustable_base_string(size); ecl_disable_interrupts(); ok = getcwd((char*)output->base_string.self, size); - if (ok == NULL && errno != ENAMETOOLONG) { + if (ok == NULL && errno != ERANGE) { perror("ext::getcwd error"); ecl_internal_error("Can't work without CWD"); }