prompt. New functions find_statusbar_bracket_match() and
do_statusbar_find_bracket(); changes to do_statusbar_input().
(DLR)
+ - Beep whenever we can't read a file or directory and have to
+ indicate it on the statusbar, as Pico does. Changes to
+ do_browser(), open_file(), and write_file(). (DLR)
+- browser.c:
+ do_browser()
+ - When setting the width of each file, use the "?" operator
+ instead of an if/else clause. (DLR)
- chars.c:
mbwidth()
- If wcwidth() returns -1 for the character passed in, treat the
#endif
if (stat(filelist[selected], &st) == -1) {
+ /* We can't open this file for some reason.
+ * Complain. */
statusbar(_("Error reading %s: %s"),
filelist[selected], strerror(errno));
beep();
* Complain. */
statusbar(_("Error reading %s: %s"),
filelist[selected], strerror(errno));
+ beep();
break;
}
* Complain. */
statusbar(_("Error reading %s: %s"), answer,
strerror(errno));
+ beep();
free(new_path);
break;
}
blank_edit();
- if (width != 0)
- j = width * editwinrows *
- ((selected / width) / editwinrows);
- else
- j = 0;
+ j = (width != 0) ? width * editwinrows * ((selected / width) /
+ editwinrows) : 0;
wmove(edit, 0, 0);
return -2;
}
statusbar(_("\"%s\" not found"), filename);
+ beep();
return -1;
} else if (S_ISDIR(fileinfo.st_mode) || S_ISCHR(fileinfo.st_mode) ||
S_ISBLK(fileinfo.st_mode)) {
statusbar(S_ISDIR(fileinfo.st_mode) ?
_("\"%s\" is a directory") :
_("File \"%s\" is a device file"), filename);
+ beep();
return -1;
} else if ((fd = open(filename, O_RDONLY)) == -1) {
statusbar(_("Error reading %s: %s"), filename, strerror(errno));
+ beep();
return -1;
} else {
/* File is A-OK. Open it in binary mode for our own end-of-line
if (*f == NULL) {
statusbar(_("Error reading %s: %s"), filename,
strerror(errno));
+ beep();
close(fd);
} else
statusbar(_("Reading File"));
if (f == NULL) {
statusbar(_("Error reading %s: %s"), realname,
strerror(errno));
+ beep();
goto cleanup_and_exit;
}
}
openfile->current_stat->st_gid) == -1 ||
utime(backupname, &filetime) == -1) {
free(backupname);
- if (copy_status == -1)
+ if (copy_status == -1) {
statusbar(_("Error reading %s: %s"), realname,
strerror(errno));
- else
+ beep();
+ } else
statusbar(_("Error writing %s: %s"), backupname,
strerror(errno));
goto cleanup_and_exit;
if (f_source == NULL) {
statusbar(_("Error reading %s: %s"), realname,
strerror(errno));
+ beep();
close(fd_source);
fclose(f);
unlink(tempname);
if (f_source == NULL) {
statusbar(_("Error reading %s: %s"), tempname,
strerror(errno));
+ beep();
fclose(f);
goto cleanup_and_exit;
}
/* Partition the filestruct so that it contains only the
* text of the justified paragraph. */
filepart = partition_filestruct(first_par_line, 0,
- last_par_line, (filebot_inpar && last_par_line ==
- openfile->filebot) ? strlen(last_par_line->data) : 0);
+ last_par_line, filebot_inpar ?
+ strlen(last_par_line->data) : 0);
/* Remove the text of the justified paragraph, and
* replace it with the text in the justify buffer. */