X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffchdir.c;fp=lib%2Ffchdir.c;h=b7ce18849d9a4f9dc11428a2ac24a81cab7b8f51;hb=a8cf3a87ebb0a719e9ebacdac9b066c8c7093cb4;hp=e55ef6ce961ebc7c1f09a0fc786c72d034bc53bd;hpb=2763d20edded7c1434d58e36c5dd05ed68784f90;p=gnulib.git diff --git a/lib/fchdir.c b/lib/fchdir.c index e55ef6ce9..b7ce18849 100644 --- a/lib/fchdir.c +++ b/lib/fchdir.c @@ -71,11 +71,11 @@ ensure_dirs_slot (size_t fd) new_allocated = 2 * dirs_allocated + 1; if (new_allocated <= fd) - new_allocated = fd + 1; + new_allocated = fd + 1; new_dirs = - (dirs != NULL - ? (dir_info_t *) realloc (dirs, new_allocated * sizeof *dirs) - : (dir_info_t *) malloc (new_allocated * sizeof *dirs)); + (dirs != NULL + ? (dir_info_t *) realloc (dirs, new_allocated * sizeof *dirs) + : (dir_info_t *) malloc (new_allocated * sizeof *dirs)); if (new_dirs == NULL) return false; memset (new_dirs + dirs_allocated, 0, @@ -94,20 +94,20 @@ get_name (char const *dir) if (REPLACE_OPEN_DIRECTORY || !HAVE_CANONICALIZE_FILE_NAME) { /* The function canonicalize_file_name has not yet been ported - to mingw, with all its drive letter and backslash quirks. - Fortunately, getcwd is reliable in this case, but we ensure - we can get back to where we started before using it. Treat - "." as a special case, as it is frequently encountered. */ + to mingw, with all its drive letter and backslash quirks. + Fortunately, getcwd is reliable in this case, but we ensure + we can get back to where we started before using it. Treat + "." as a special case, as it is frequently encountered. */ char *cwd = getcwd (NULL, 0); int saved_errno; if (dir[0] == '.' && dir[1] == '\0') - return cwd; + return cwd; if (chdir (cwd)) - return NULL; + return NULL; result = chdir (dir) ? NULL : getcwd (NULL, 0); saved_errno = errno; if (chdir (cwd)) - abort (); + abort (); free (cwd); errno = saved_errno; }