summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/getpath.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 589b7ae..09b795d 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -437,7 +437,7 @@ calculate_path()
{
char tmpbuffer[MAXPATHLEN+1];
int linklen = readlink(progpath, tmpbuffer, MAXPATHLEN);
- if (linklen != -1) {
+ while (linklen != -1) {
/* It's not null terminated! */
tmpbuffer[linklen] = '\0';
if (tmpbuffer[0] == SEP)
@@ -447,6 +447,7 @@ calculate_path()
reduce(argv0_path);
joinpath(argv0_path, tmpbuffer);
}
+ linklen = readlink(argv0_path, tmpbuffer, MAXPATHLEN);
}
}
#endif /* HAVE_READLINK */