va_list va;
char buf[1024];
int len;
+ int style;
/* XXX Too lazy to do this right
* (try again with a bigger buf if necessary). */
/* Solaris 2.6's cc complains if the below cast is missing */
print_c_string("\n\n");
os_beep(BEEP_HIGH);
+ style = os_get_text_style();
os_set_text_style(BOLDFACE_STYLE);
print_c_string("Warning: ");
- os_set_text_style(0);
+ os_set_text_style(NORMAL_STYLE);
print_c_string((len < 0 ? s : buf));
print_c_string("\n");
if (len < 0)
else if (len >= sizeof(buf))
print_c_string("(truncated)\n");
new_line();
+ os_set_text_style(style);
}
}
+/*
+ * os_get_text_style
+ *
+ * Return the current text style. Following flags can be set:
+ *
+ * REVERSE_STYLE
+ * BOLDFACE_STYLE
+ * EMPHASIS_STYLE (aka underline aka italics)
+ * FIXED_WIDTH_STYLE
+ *
+ */
+int os_get_text_style (void)
+{
+ return current.style;
+} /* os_get_text_style */
+
+
/*
* os_set_text_style
*
* and our filename is already provided with the -L flag,
* just go ahead silently.
*/
- if (f_setup.restore_mode) {
+ if (flag == FILE_NO_PROMPT) {
+ const char *ext = strrchr(default_name, '.');
+ if (strncmp(ext, EXT_AUX, 4)) {
+ os_warn("Blocked unprompted access of %s. Should only be %s files.", default_name, EXT_AUX);
+ return NULL;
+ } else
+ strncpy(file_name, default_name, FILENAME_MAX);
+ } else if (f_setup.restore_mode) {
strncpy(file_name, f_setup.save_name, FILENAME_MAX);
} else {
st = dialog_read_file_name(file_name, initname, flag);