*** Note that backspace key makes input be off by one when entring
*** a string > COLS in length. This must be fixed before a new release
-
+- files.c:
+ do_writeout()
+ - Change strcpy to answer to mallocstrcpy.
- global.c
- New global replace_list_2, for 2nd half of the replace dialog
("Replace with:"), has fewer options than first half because
{
int i = 0;
- strncpy(answer, filename, 132);
+ answer = mallocstrcpy(answer, filename);
if ((exiting) && (ISSET(TEMP_OPT))) {
if (filename[0]) {
#ifdef DEBUG
fprintf(stderr, _("filename is %s"), answer);
#endif
- if (strncmp(answer, filename, 132)) {
+ if (strcmp(answer, filename)) {
struct stat st;
if (!stat(answer, &st)) {
i = do_yesno(0, 0, _("File exists, OVERWRITE ?"));
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-11-02 00:10-0500\n"
+"POT-Creation-Date: 2000-11-02 09:51-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
#: global.c:344 global.c:364 global.c:375 global.c:385 global.c:401
-#: global.c:405 global.c:411 winio.c:981
+#: global.c:405 global.c:411 winio.c:983
msgid "Cancel"
msgstr ""
msgid "actual_x_from_start for xplus=%d returned %d\n"
msgstr ""
-#: winio.c:398
+#: winio.c:399
#, c-format
msgid "input '%c' (%d)\n"
msgstr ""
-#: winio.c:434
+#: winio.c:436
msgid "New Buffer"
msgstr ""
-#: winio.c:437
+#: winio.c:439
msgid " File: ..."
msgstr ""
-#: winio.c:445
+#: winio.c:447
msgid "Modified"
msgstr ""
-#: winio.c:897
+#: winio.c:899
#, c-format
msgid "Moved to (%d, %d) in edit buffer\n"
msgstr ""
-#: winio.c:908
+#: winio.c:910
#, c-format
msgid "current->data = \"%s\"\n"
msgstr ""
-#: winio.c:951
+#: winio.c:953
#, c-format
msgid "I got \"%s\"\n"
msgstr ""
-#: winio.c:976
+#: winio.c:978
msgid "Yes"
msgstr ""
-#: winio.c:978
+#: winio.c:980
msgid "All"
msgstr ""
-#: winio.c:980
+#: winio.c:982
msgid "No"
msgstr ""
-#: winio.c:1117
+#: winio.c:1119
#, c-format
msgid "do_cursorpos: linepct = %f, bytepct = %f\n"
msgstr ""
-#: winio.c:1121
+#: winio.c:1123
msgid "line %d of %d (%.0f%%), character %d of %d (%.0f%%)"
msgstr ""
-#: winio.c:1249
+#: winio.c:1251
msgid "Dumping file buffer to stderr...\n"
msgstr ""
-#: winio.c:1251
+#: winio.c:1253
msgid "Dumping cutbuffer to stderr...\n"
msgstr ""
-#: winio.c:1253
+#: winio.c:1255
msgid "Dumping a buffer to stderr...\n"
msgstr ""
void nanoget_repaint(char *buf, char *inputbuf, int x)
{
blank_statusbar();
- if (x <= COLS) {
+ if (x <= COLS - 1) {
mvwaddstr(bottomwin, 0, 0, buf);
- waddnstr(bottomwin, inputbuf, COLS - strlen(buf));
+ waddnstr(bottomwin, inputbuf, (COLS - 1) - strlen(buf));
- } else if (x > COLS && x <= COLS * 2)
- mvwaddnstr(bottomwin, 0, 0, &inputbuf[COLS - strlen(buf)], COLS);
+ } else if (x > COLS - 1 && x <= (COLS - 1) * 2)
+ mvwaddnstr(bottomwin, 0, 0, &inputbuf[(COLS - 1) - strlen(buf)], COLS);
else
- mvwaddnstr(bottomwin, 0, 0, &inputbuf[COLS * (x / COLS) -
+ mvwaddnstr(bottomwin, 0, 0, &inputbuf[COLS * (x / (COLS - 1)) -
strlen(buf)], COLS);
- wmove(bottomwin, 0, (x % COLS));
+ wmove(bottomwin, 0, (x % (COLS - 1)));
}
for (j = 0; j <= slen - 1; j++) {
if (kbinput == s[j].val) {
answer = mallocstrcpy(answer, "");
+ free(inputbuf);
return s[j].val;
}
}
}
answer = mallocstrcpy(answer, inputbuf);
+ free(inputbuf);
/* Now that the text is editable instead of bracketed, we have to
check for answer == def, instead of answer == "" */