/* expand - convert tabs to spaces
- Copyright (C) 1989, 1991, 1995-2006, 2008-2011 Free Software Foundation,
- Inc.
+ Copyright (C) 1989-2013 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
#include "quote.h"
#include "xstrndup.h"
-/* The official name of this program (e.g., no `g' prefix). */
+/* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "expand"
#define AUTHORS proper_name ("David MacKenzie")
read on the line. */
static bool convert_entire_line;
-/* If nonzero, the size of all tab stops. If zero, use `tab_list' instead. */
+/* If nonzero, the size of all tab stops. If zero, use 'tab_list' instead. */
static uintmax_t tab_size;
/* Array of the explicit column numbers of the tab stops;
- after `tab_list' is exhausted, each additional tab is replaced
+ after 'tab_list' is exhausted, each additional tab is replaced
by a space. The first column is column 0. */
static uintmax_t *tab_list;
-/* The number of allocated entries in `tab_list'. */
+/* The number of allocated entries in 'tab_list'. */
static size_t n_tabs_allocated;
-/* The index of the first invalid element of `tab_list',
+/* The index of the first invalid element of 'tab_list',
where the next element can be added. */
static size_t first_free_tab;
/* Null-terminated array of input filenames. */
static char **file_list;
-/* Default for `file_list' if no files are given on the command line. */
+/* Default for 'file_list' if no files are given on the command line. */
static char *stdin_argv[] =
{
(char *) "-", NULL
usage (int status)
{
if (status != EXIT_SUCCESS)
- fprintf (stderr, _("Try `%s --help' for more information.\n"),
- program_name);
+ emit_try_help ();
else
{
printf (_("\
exit (status);
}
-/* Add tab stop TABVAL to the end of `tab_list'. */
+/* Add tab stop TABVAL to the end of 'tab_list'. */
static void
add_tab_stop (uintmax_t tabval)
/* Close the old stream pointer FP if it is non-NULL,
and return a new one opened to read the next input file.
- Open a filename of `-' as the standard input.
+ Open a filename of '-' as the standard input.
Return NULL if there are no more input files. */
static FILE *
}
/* Change tabs to spaces, writing to stdout.
- Read each file in `file_list', in order. */
+ Read each file in 'file_list', in order. */
static void
expand (void)