empty string so that diagnostics say "ownership :GROUP"
rather than "group GROUP". */
if (!chopt.user_name && chopt.group_name)
- chopt.user_name = "";
+ chopt.user_name = bad_cast ("");
optind++;
}
/* No command. Run an interactive shell. */
char *shell = getenv ("SHELL");
if (shell == NULL)
- shell = "/bin/sh";
+ shell = bad_cast ("/bin/sh");
argv[0] = shell;
- argv[1] = "-i";
+ argv[1] = bad_cast ("-i");
argv[2] = NULL;
}
else
/* POSIX says that `date -u' is equivalent to setting the TZ
environment variable, so this option should do nothing other
than setting TZ. */
- if (putenv ("TZ=UTC0") != 0)
+ if (putenv (bad_cast ("TZ=UTC0")) != 0)
xalloc_die ();
TZSET;
break;
/* If true, display only a total for each argument. */
bool opt_summarize_only = false;
- cwd_only[0] = ".";
+ cwd_only[0] = bad_cast (".");
cwd_only[1] = NULL;
initialize_main (&argc, &argv);
/* Default for `file_list' if no files are given on the command line. */
static char *stdin_argv[] =
{
- "-", NULL
+ (char *) "-", NULL
};
/* True if we have ever read standard input. */
case FULL_TIME_OPTION:
format = long_format;
- time_style_option = "full-iso";
+ time_style_option = bad_cast ("full-iso");
break;
case COLOR_OPTION:
if (! style)
if (! (style = getenv ("TIME_STYLE")))
- style = "locale";
+ style = bad_cast ("locale");
while (strncmp (style, posix_prefix, sizeof posix_prefix - 1) == 0)
{
binary = 0;
if (optind == argc)
- argv[argc++] = "-";
+ argv[argc++] = bad_cast ("-");
for (; optind < argc; ++optind)
{
}
if (optind == argc)
- argv[argc++] = "-";
+ argv[argc++] = bad_cast ("-");
if (collapse_escapes (delim_arg))
{
/* String used to separate columns if the -S option has been specified.
Default without -S but together with one of the column options
-a|COLUMN|-m is a `space' and with the -J option a `tab'. */
-static char *col_sep_string = "";
+static char *col_sep_string = (char *) "";
static int col_sep_length = 0;
-static char *column_separator = " ";
-static char *line_separator = "\t";
+static char *column_separator = (char *) " ";
+static char *line_separator = (char *) "\t";
/* Number of separator characters waiting to be printed as soon as we
know that we have any input remaining to be printed. */
case 'S':
old_s = false;
/* Reset an additional input of -s, -S dominates -s */
- col_sep_string = "";
+ col_sep_string = bad_cast ("");
col_sep_length = 0;
use_col_separator = true;
if (optarg)
if (nfiles == 0)
{
- static char *minus = "-";
+ static char *minus = (char *) "-";
nfiles = 1;
free (files);
files = −
/* Parse command line options. */
- infile = "-";
- outbase = "x";
+ infile = bad_cast ( "-");
+ outbase = bad_cast ("x");
while (1)
{
? imaxtostr (t, buf)
: umaxtostr (t, buf));
}
+
+static inline char *
+bad_cast (char const *s)
+{
+ return (char *) s;
+}
}
else
{
- static char *dummy_stdin = "-";
+ static char *dummy_stdin = (char *) "-";
n_files = 1;
file = &dummy_stdin;
/* Default for `file_list' if no files are given on the command line. */
static char *stdin_argv[] =
{
- "-", NULL
+ (char *) "-", NULL
};
/* True if we have ever read standard input. */
if (argc <= optind)
{
optind = argc;
- argv[argc++] = "y";
+ argv[argc++] = bad_cast ("y");
}
for (;;)