- When saving or changing file positions, be sure not to ignore
placewewant. Changes to do_int_spell_fix(), findnextstr(),
do_replace_loop(), and do_replace(). (DLR)
- - Convert current_x to a size_t, and convert some functions that
- use it as a parameter to use size_t as well. Also change some
- current_x-related assertions to handle it. (David Benbennick
- and DLR)
+ - Convert current_x and mark_beginx to size_t's, and convert
+ some functions that use them as a parameter to use size_t as
+ well. Also change some related assertions to handle them.
+ (David Benbennick and DLR)
- files.c:
do_insertfile()
- Simplify by reusing variables whereever possible, and add a
#ifndef NANO_SMALL
filestruct *mark_beginbuf; /* The begin marker buffer */
-int mark_beginx; /* X value in the string to start */
+size_t mark_beginx; /* X value in the string to start */
#endif
#ifndef DISABLE_OPERATINGDIR
filestruct *edittop_save = edittop, *current_save = current;
#ifndef NANO_SMALL
filestruct *mark_beginbuf_save = mark_beginbuf;
- int mark_beginx_save = mark_beginx;
+ size_t mark_beginx_save = mark_beginx;
#endif
int kbinput;
bool meta_key, func_key;
struct filestruct *file_mark_beginbuf;
/* Current file's beginning marked
* line. */
- int file_mark_beginx; /* Current file's beginning marked
+ size_t file_mark_beginx; /* Current file's beginning marked
* line's x-coordinate position. */
#endif
size_t file_current_x; /* Current file's x-coordinate
extern int totlines;
extern size_t placewewant;
#ifndef NANO_SMALL
-extern int mark_beginx;
+extern size_t mark_beginx;
#endif
extern long totsize;
extern long flags;
if (i > 0 || replaceall) { /* Yes, replace it!!!! */
char *copy;
- ssize_t length_change;
+ size_t length_change;
if (i == 2)
replaceall = TRUE;
}
#endif
- assert(0 <= match_len + length_change);
if (current == real_current && current_x <= *real_current_x) {
if (*real_current_x < current_x + match_len)
*real_current_x = current_x + match_len;