/* expand - convert tabs to spaces
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1991, 1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
David MacKenzie <djm@gnu.ai.mit.edu> */
-#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
/* Get isblank from GNU libc. */
#define _GNU_SOURCE
#include <sys/types.h>
#include "system.h"
#include "version.h"
+#include "error.h"
/* The number of bytes added at a time to the amount of memory
allocated for the output line. */
char *xmalloc ();
char *xrealloc ();
-void error ();
static FILE *next_file ();
static void add_tabstop ();
if (show_version)
{
- printf ("%s\n", version_string);
+ printf ("expand - %s\n", version_string);
exit (0);
}
if (tabval == -1)
return;
if (first_free_tab % TABLIST_BLOCK == 0)
- tab_list = (int *) xrealloc (tab_list, first_free_tab + TABLIST_BLOCK);
+ tab_list = (int *) xrealloc (tab_list, first_free_tab
+ + TABLIST_BLOCK * sizeof (tab_list[0]));
tab_list[first_free_tab++] = tabval;
}
",
program_name);
printf ("\
+Convert tabs in each FILE to spaces, writing to standard output.\n\
+With no FILE, or when FILE is -, read standard input.\n\
\n\
-i, --initial do not convert TABs after non whitespace\n\
-t, --tabs=NUMBER have tabs NUMBER characters apart, not 8\n\
--help display this help and exit\n\
--version output version information and exit\n\
\n\
-Instead of -t NUMBER or -t LIST, -NUMBER or -LIST may be used. With\n\
-no FILE, or when FILE is -, read standard input.\n\
+Instead of -t NUMBER or -t LIST, -NUMBER or -LIST may be used.\n\
");
}
exit (status);