summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1994-10-02 02:09:38 +0000
committerJim Meyering <jim@meyering.net>1994-10-02 02:09:38 +0000
commitf17c045d219e48e96f7a35d37f239627fa0f8fcf (patch)
treec1cc2f8565c315aebefda2e283632a00595fa4d0 /src/ls.c
parentb055972c6b12e52f0e41a47d47b711e10b530c1b (diff)
downloadcoreutils-f17c045d219e48e96f7a35d37f239627fa0f8fcf.tar.xz
.
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/ls.c b/src/ls.c
index da0c1d66e..551871c78 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -36,17 +36,7 @@
#pragma alloca
#endif
-#ifdef HAVE_CONFIG_H
-#if defined (CONFIG_BROKETS)
-/* We use <config.h> instead of "config.h" so that a compilation
- using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
- (which it would do because it found this file in $srcdir). */
#include <config.h>
-#else
-#include "config.h"
-#endif
-#endif
-
#include <sys/types.h>
#if !defined(_POSIX_SOURCE) || defined(_AIX)
#include <sys/ioctl.h>
@@ -58,17 +48,25 @@
#include "system.h"
#include <fnmatch.h>
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
#include "ls.h"
#include "version.h"
#include "safe-stat.h"
#include "safe-lstat.h"
+#ifndef INT_MAX
+#define INT_MAX (((unsigned int) ~(unsigned int) 0) >> 1)
+#endif
+
#ifndef S_IEXEC
#define S_IEXEC S_IXUSR
#endif
/* Return an int indicating the result of comparing two longs. */
-#if SIZEOF_INT == 2
+#if (INT_MAX <= 65535)
#define longdiff(a, b) ((a) < (b) ? -1 : (a) > (b) ? 1 : 0)
#else
#define longdiff(a, b) ((a) - (b))