and reset tabsize and wrap_at to their default values if invalid rcfile
entries are specified for them git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1860 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
36dd87b1fb
commit
04419b9702
|
@ -38,7 +38,9 @@ CVS code -
|
||||||
errors. Also exit instead of calling usage() in the event of
|
errors. Also exit instead of calling usage() in the event of
|
||||||
an invalid fill value, for consistency with how an invalid
|
an invalid fill value, for consistency with how an invalid
|
||||||
tabsize value is handled. Finally, handle invalid tabsize
|
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
|
- Remove several unnecessary reset_cursor() calls. (David
|
||||||
Benbennick)
|
Benbennick)
|
||||||
- Include <sys/types.h> in proto.h. (David Benbennick) DLR:
|
- Include <sys/types.h> in proto.h. (David Benbennick) DLR:
|
||||||
|
|
|
@ -3336,7 +3336,7 @@ int main(int argc, char *argv[])
|
||||||
alt_speller = alt_speller_cpy;
|
alt_speller = alt_speller_cpy;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (tabsize_cpy > 0)
|
if (tabsize_cpy != -1)
|
||||||
tabsize = tabsize_cpy;
|
tabsize = tabsize_cpy;
|
||||||
flags |= flags_cpy;
|
flags |= flags_cpy;
|
||||||
}
|
}
|
||||||
|
|
11
src/rcfile.c
11
src/rcfile.c
|
@ -420,8 +420,7 @@ void parse_colors(char *ptr)
|
||||||
if (tmpsyntax->color == NULL) {
|
if (tmpsyntax->color == NULL) {
|
||||||
tmpsyntax->color = newcolor;
|
tmpsyntax->color = newcolor;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "Starting a new colorstring for fg %d bg %d\n",
|
fprintf(stderr, "Starting a new colorstring for fg %d bg %d\n", fg, bg);
|
||||||
fg, bg);
|
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
for (tmpcolor = tmpsyntax->color; tmpcolor->next != NULL;
|
for (tmpcolor = tmpsyntax->color; tmpcolor->next != NULL;
|
||||||
|
@ -563,8 +562,10 @@ void parse_rcfile(FILE *rcstream)
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_WRAPJUSTIFY
|
#ifndef DISABLE_WRAPJUSTIFY
|
||||||
if (!strcasecmp(rcopts[i].name, "fill")) {
|
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);
|
rcfile_error(N_("Requested fill size %s invalid"), option);
|
||||||
|
wrap_at = -CHARS_FROM_EOL;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
|
@ -609,9 +610,9 @@ void parse_rcfile(FILE *rcstream)
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (!strcasecmp(rcopts[i].name, "tabsize")) {
|
if (!strcasecmp(rcopts[i].name, "tabsize")) {
|
||||||
if (parse_num(option, &tabsize) == -1 ||
|
if (parse_num(option, &tabsize) == -1 || tabsize <= 0)
|
||||||
tabsize <= 0)
|
|
||||||
rcfile_error(N_("Requested tab size %s invalid"), option);
|
rcfile_error(N_("Requested tab size %s invalid"), option);
|
||||||
|
tabsize = -1;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
SET(rcopts[i].flag);
|
SET(rcopts[i].flag);
|
||||||
|
|
Loading…
Reference in New Issue