From d1d62b539d3332d2cd23fa9b56d999fa2bc5ebfc Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 10 Mar 2000 20:18:07 +0000 Subject: Update. * manual/filesys.texi (Working Directory): Fix last patch. Patch by Martin Buchholz . 2000-03-10 Andreas Jaeger --- manual/filesys.texi | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'manual/filesys.texi') diff --git a/manual/filesys.texi b/manual/filesys.texi index e2c9ffb432..0f27cfcfd9 100644 --- a/manual/filesys.texi +++ b/manual/filesys.texi @@ -91,17 +91,18 @@ using only the standard behavior of @code{getcwd}: @smallexample char * -gnu_getcwd (size_t size) +gnu_getcwd () @{ + size_t size = 100; + while (1) @{ char *buffer = (char *) xmalloc (size); - char *value = getcwd (buffer, size); - if (value == buffer) - return value; + if (getcwd (buffer, size) == buffer) + return buffer; free (buffer); if (errno != ERANGE) - return value; + return 0; size *= 2; @} @} -- cgit 1.4.1