log = open_file (DEBUG_FILE, "w");
#endif
- while ((opt = getopt_long (argc, argv, "hv", long_opts, NULL)) != -1)
+ while ((opt = getopt_long (argc, argv, "hV", long_opts, NULL)) != -1)
{
PARSE_OPT:
switch (opt)
break;
case 'h':
SET_OPT_TYPE (OPT_HELP);
- case 'v':
+ case 'V':
SET_OPT_TYPE (OPT_VERSION);
case '?':
print_hint ();
printf ("\t\t --clean-all\n");
printf ("\t\t --exclude-random\n");
printf ("\t\t-h, --help\n");
- printf ("\t\t-v, --version\n\n");
+ printf ("\t\t-V, --version\n\n");
}
static void
unsigned int i;
for (i = 0; i < stacked_vars; i++)
if (vars_list[i])
- free_null (vars_list[i]);
+ free (vars_list[i]);
free_null (vars_list);
}
unsigned int i;
for (i = 0; color_names[i]; i++)
{
- free_null (color_names[i]->name);
- free_null (color_names[i]->orig);
+ free (color_names[i]->name);
+ free (color_names[i]->orig);
free_null (color_names[i]);
}
}
break;
case BACKGROUND:
vfprintf_fail (formats[FMT_COLOR], tables[BACKGROUND].desc, color, "cannot be bold");
- break;
default: /* never reached */
ABORT_TRACE ();
}
if (color_names[BACKGROUND])
{
unsigned int i;
- unsigned int color_sets[2][2] = { { FOREGROUND, BACKGROUND }, { BACKGROUND, FOREGROUND } };
+ const unsigned int color_sets[2][2] = { { FOREGROUND, BACKGROUND }, { BACKGROUND, FOREGROUND } };
for (i = 0; i < 2; i++)
{
- unsigned int color1 = color_sets[i][0];
- unsigned int color2 = color_sets[i][1];
+ const unsigned int color1 = color_sets[i][0];
+ const unsigned int color2 = color_sets[i][1];
if (CHECK_COLORS_RANDOM (color1, color2))
vfprintf_fail (formats[FMT_RANDOM], tables[color1].desc, color_names[color1]->orig, "cannot be combined with", color_names[color2]->orig);
}
int ret;
errno = 0;
- ret = lstat (file, &sb);
+ ret = stat (file, &sb);
if (ret == -1)
vfprintf_fail (formats[FMT_FILE], file, strerror (errno));
RESTORE_CHAR (offsets[i + 1][0], ch);
}
for (i = 0; i < count; i++)
- free_null (offsets[i]);
+ free (offsets[i]);
free_null (offsets);
}