summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index f2a2417ddd..d553ce6077 100644
--- a/monitor.c
+++ b/monitor.c
@@ -106,6 +106,33 @@ void term_printf(const char *fmt, ...)
va_end(ap);
}
+void term_print_filename(const char *filename)
+{
+ int i;
+
+ for (i = 0; filename[i]; i++) {
+ switch (filename[i]) {
+ case ' ':
+ case '"':
+ case '\\':
+ term_printf("\\%c", filename[i]);
+ break;
+ case '\t':
+ term_printf("\\t");
+ break;
+ case '\r':
+ term_printf("\\r");
+ break;
+ case '\n':
+ term_printf("\\n");
+ break;
+ default:
+ term_printf("%c", filename[i]);
+ break;
+ }
+ }
+}
+
static int monitor_fprintf(FILE *stream, const char *fmt, ...)
{
va_list ap;