currshortcut and currslen #ifdefs to depend on both
DISABLE_HELP and DISABLE_MOUSE being defined to not
include. Changed all the shortcuts and lengths.
+ - Fixed null_at to ACTUALLY DO SOMETHING with its arg. Again,
+ this was causing nasty errors if the call to nrealloc moved
+ where the data was located.
- cut.c:
do_cut_text()
- Check to see whether marked text is contained within edit
screwed somewhere. Not doing this causes update_line to annihilate
the last line copied into the cutbuffer when the mark is set ?!?!? */
botcopy = copy_node(bot);
- null_at(botcopy->data, bot_x);
+ null_at(&botcopy->data, bot_x);
next = botcopy->next;
add_to_cutbuffer(botcopy);
tmp->data = charalloc(strlen(¤t->data[current_x]) + 1);
strcpy(tmp->data, ¤t->data[current_x]);
splice_node(current, tmp, current->next);
- null_at(current->data, current_x);
+ null_at(¤t->data, current_x);
current = current->next;
current_x = 0;
placewewant = 0;
open_files = open_files->next;
/* if open_files->file is NULL at the nrealloc() below, we get a
- segfault */
- open_files->file = open_files;
+ segfault
+ open_files->file = open_files; */
}
/* save current filename */
open_files->lineno = current->lineno;
/* save current filestruct */
- open_files->file = nrealloc(open_files->file, sizeof(filestruct));
+ open_files->file = nmalloc(sizeof(filestruct));
while (current->prev)
current = current->prev;
open_files->file = copy_filestruct(current);
/* otherwise, remove all non-path elements from d_there
(i. e. everything after the last slash) */
last_slash_index = strlen(d_there) - strlen(last_slash);
- null_at(d_there, last_slash_index + 1);
+ null_at(&d_there, last_slash_index + 1);
/* and remove all non-file elements from d_there_file (i. e.
everything before and including the last slash); if we
}
/* Null a string at a certain index and align it */
-void null_at(char *data, int index)
+void null_at(char **data, int index)
{
- data[index] = 0;
- align(&data);
+
+ /* Ahh! Damn dereferencing */
+ (*data)[index] = 0;
+ align(data);
}
void usage(void)
down = 1;
}
- null_at(inptr->data, current_x);
+ null_at(&inptr->data, current_x);
if (ISSET(MARK_ISSET) && (mark_beginbuf == inptr)) {
mark_beginbuf = temp;
i = current_word_start - 1;
current_x = current_word_start;
- null_at(inptr->data, current_word_start);
+ null_at(&inptr->data, current_word_start);
/* Increment totsize to account for the new line that
will be added below, so that it won't end up being
void new_file(void);
void new_magicline(void);
void splice_node(filestruct *begin, filestruct *newnode, filestruct *end);
-void null_at(char *data, int index);
+void null_at(char **data, int index);
void page_up(void);
void blank_edit(void);
void search_init_globals(void);