mirror of git://git.sv.gnu.org/nano.git
tweaks: chuck a couple of useless asserts
This commit is contained in:
parent
c38f571d4b
commit
61bc248555
|
@ -344,8 +344,6 @@ char *do_browse_from(const char *inpath)
|
||||||
char *path;
|
char *path;
|
||||||
/* This holds the tilde-expanded version of inpath. */
|
/* This holds the tilde-expanded version of inpath. */
|
||||||
|
|
||||||
assert(inpath != NULL);
|
|
||||||
|
|
||||||
path = real_dir_from_tilde(inpath);
|
path = real_dir_from_tilde(inpath);
|
||||||
|
|
||||||
/* Perhaps path is a directory. If so, we'll pass it to
|
/* Perhaps path is a directory. If so, we'll pass it to
|
||||||
|
@ -790,8 +788,6 @@ char *striponedir(const char *path)
|
||||||
{
|
{
|
||||||
char *retval, *tmp;
|
char *retval, *tmp;
|
||||||
|
|
||||||
assert(path != NULL);
|
|
||||||
|
|
||||||
retval = mallocstrcpy(NULL, path);
|
retval = mallocstrcpy(NULL, path);
|
||||||
|
|
||||||
tmp = strrchr(retval, '/');
|
tmp = strrchr(retval, '/');
|
||||||
|
|
|
@ -108,8 +108,6 @@ void color_init(void)
|
||||||
bool using_defaults = FALSE;
|
bool using_defaults = FALSE;
|
||||||
short foreground, background;
|
short foreground, background;
|
||||||
|
|
||||||
assert(openfile != NULL);
|
|
||||||
|
|
||||||
/* If the terminal is not capable of colors, forget it. */
|
/* If the terminal is not capable of colors, forget it. */
|
||||||
if (!has_colors())
|
if (!has_colors())
|
||||||
return;
|
return;
|
||||||
|
@ -164,8 +162,6 @@ void color_update(void)
|
||||||
syntaxtype *sint = NULL;
|
syntaxtype *sint = NULL;
|
||||||
colortype *ink;
|
colortype *ink;
|
||||||
|
|
||||||
assert(openfile != NULL);
|
|
||||||
|
|
||||||
/* If the rcfiles were not read, or contained no syntaxes, get out. */
|
/* If the rcfiles were not read, or contained no syntaxes, get out. */
|
||||||
if (syntaxes == NULL)
|
if (syntaxes == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -82,8 +82,6 @@ void cut_to_eol(void)
|
||||||
{
|
{
|
||||||
size_t data_len = strlen(openfile->current->data);
|
size_t data_len = strlen(openfile->current->data);
|
||||||
|
|
||||||
assert(openfile->current_x <= data_len);
|
|
||||||
|
|
||||||
if (openfile->current_x < data_len)
|
if (openfile->current_x < data_len)
|
||||||
/* If we're not at the end of the line, move all the text from
|
/* If we're not at the end of the line, move all the text from
|
||||||
* the current position up to it, not counting the newline at
|
* the current position up to it, not counting the newline at
|
||||||
|
@ -129,8 +127,6 @@ void do_cut_text(bool copy_text, bool cut_till_eof)
|
||||||
#endif
|
#endif
|
||||||
size_t was_totsize = openfile->totsize;
|
size_t was_totsize = openfile->totsize;
|
||||||
|
|
||||||
assert(openfile->current != NULL && openfile->current->data != NULL);
|
|
||||||
|
|
||||||
/* If a chain of cuts was broken, empty the cutbuffer. */
|
/* If a chain of cuts was broken, empty the cutbuffer. */
|
||||||
if (!keep_cutbuffer) {
|
if (!keep_cutbuffer) {
|
||||||
free_filestruct(cutbuffer);
|
free_filestruct(cutbuffer);
|
||||||
|
@ -262,8 +258,6 @@ void do_uncut_text(void)
|
||||||
{
|
{
|
||||||
ssize_t was_lineno = openfile->current->lineno;
|
ssize_t was_lineno = openfile->current->lineno;
|
||||||
|
|
||||||
assert(openfile->current != NULL && openfile->current->data != NULL);
|
|
||||||
|
|
||||||
/* If the cutbuffer is empty, get out. */
|
/* If the cutbuffer is empty, get out. */
|
||||||
if (cutbuffer == NULL)
|
if (cutbuffer == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue