Mercurial > gnulib
diff lib/progreloc.c @ 14384:588ed4cdea87
Fix misindentation of preprocessor directives.
* lib/argp-namefrob.h: Reindent preprocessor directives.
* lib/getopt_int.h (struct _getopt_data): Likewise.
* lib/progreloc.c (maybe_executable, find_executable): Likewise.
* lib/vasnprintf.c (decode_long_double): Likewise.
* tests/test-argmatch.c: Insert blank lines, for clarity.
* tests/test-exclude.c: Likewise.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Wed, 23 Feb 2011 10:58:06 +0100 |
parents | 97fc9a21a8fb |
children | 5e10178f1466 |
line wrap: on
line diff
--- a/lib/progreloc.c Wed Feb 23 00:01:03 2011 +0100 +++ b/lib/progreloc.c Wed Feb 23 10:58:06 2011 +0100 @@ -117,7 +117,7 @@ if (access (filename, X_OK) < 0) return false; -#ifdef __linux__ +# ifdef __linux__ if (executable_fd >= 0) { /* If we already have an executable_fd, check that filename points to @@ -135,7 +135,7 @@ return false; } } -#endif +# endif #endif return true; @@ -157,7 +157,7 @@ /* Shouldn't happen. */ return NULL; { -#if defined __CYGWIN__ +# if defined __CYGWIN__ /* cygwin-1.5.13 (2005-03-01) or newer would also allow a Linux-like implementation: readlink of "/proc/self/exe". But using the result of the Win32 system call is simpler and is consistent with the @@ -176,12 +176,12 @@ return NULL; /* Call canonicalize_file_name, because Cygwin supports symbolic links. */ return canonicalize_file_name (location_as_posix_path); -#else +# else return xstrdup (location); -#endif +# endif } #else /* Unix && !Cygwin */ -#ifdef __linux__ +# ifdef __linux__ /* The executable is accessible as /proc/<pid>/exe. In newer Linux versions, also as /proc/self/exe. Linux >= 2.1 provides a symlink to the true pathname; older Linux versions give only device and ino, @@ -205,8 +205,8 @@ executable_fd = open (buf, O_EXEC, 0); } } -#endif -#if HAVE_MACH_O_DYLD_H && HAVE__NSGETEXECUTABLEPATH +# endif +# if HAVE_MACH_O_DYLD_H && HAVE__NSGETEXECUTABLEPATH /* On MacOS X 10.2 or newer, the function int _NSGetExecutablePath (char *buf, uint32_t *bufsize); can be used to retrieve the executable's full path. */ @@ -215,7 +215,7 @@ if (_NSGetExecutablePath (location, &length) == 0 && location[0] == '/') return canonicalize_file_name (location); -#endif +# endif /* Guess the executable's full path. We assume the executable has been called via execlp() or execvp() with properly set up argv[0]. The login(1) convention to add a '-' prefix to argv[0] is not supported. */ @@ -256,10 +256,10 @@ /* We have a path item at p, of length p_len. Now concatenate the path item and argv0. */ concat_name = (char *) xmalloc (p_len + strlen (argv0) + 2); -#ifdef NO_XMALLOC +# ifdef NO_XMALLOC if (concat_name == NULL) return NULL; -#endif +# endif if (p_len == 0) /* An empty PATH element designates the current directory. */ strcpy (concat_name, argv0);