errors. Also exit instead of calling usage() in the event of
an invalid fill value, for consistency with how an invalid
tabsize value is handled. Finally, handle invalid tabsize
- entries in the rcfile the same way as on the command line.
+ entries in the rcfile the same way as on the command line,
+ and reset tabsize and wrap_at to their default values if
+ invalid rcfile entries are specified for them.
- Remove several unnecessary reset_cursor() calls. (David
Benbennick)
- Include <sys/types.h> in proto.h. (David Benbennick) DLR:
if (tmpsyntax->color == NULL) {
tmpsyntax->color = newcolor;
#ifdef DEBUG
- fprintf(stderr, "Starting a new colorstring for fg %d bg %d\n",
- fg, bg);
+ fprintf(stderr, "Starting a new colorstring for fg %d bg %d\n", fg, bg);
#endif
} else {
for (tmpcolor = tmpsyntax->color; tmpcolor->next != NULL;
#endif
#ifndef DISABLE_WRAPJUSTIFY
if (!strcasecmp(rcopts[i].name, "fill")) {
- if (parse_num(option, &wrap_at) == -1)
+ if (parse_num(option, &wrap_at) == -1) {
rcfile_error(N_("Requested fill size %s invalid"), option);
+ wrap_at = -CHARS_FROM_EOL;
+ }
} else
#endif
#ifndef NANO_SMALL
else
#endif
if (!strcasecmp(rcopts[i].name, "tabsize")) {
- if (parse_num(option, &tabsize) == -1 ||
- tabsize <= 0)
+ if (parse_num(option, &tabsize) == -1 || tabsize <= 0)
rcfile_error(N_("Requested tab size %s invalid"), option);
+ tabsize = -1;
}
} else
SET(rcopts[i].flag);