[!INT_MAX]: Define it.
(main): Append INT_MAX to command-line-specified tab list to
ensure termination in unexpand's inner loop.
Derived from a patch from Keith Owens.
#include <getopt.h>
#include <sys/types.h>
#include "system.h"
+
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
+#ifndef UINT_MAX
+# define UINT_MAX ((unsigned int) ~(unsigned int) 0)
+#endif
+
+#ifndef INT_MAX
+# define INT_MAX ((int) (UINT_MAX >> 1))
+#endif
+
#include "error.h"
/* The number of bytes added at a time to the amount of memory
else if (first_free_tab == 1)
tab_size = tab_list[0];
else
- tab_size = 0;
+ {
+ /* Append a sentinel to the list of tab stop indices. */
+ add_tabstop (INT_MAX);
+ tab_size = 0;
+ }
if (optind == argc)
file_list = stdin_argv;