summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/util/shared.c8
-rw-r--r--src/util/shared.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/util/shared.c b/src/util/shared.c
index 8f2fe93..5e08b8d 100644
--- a/src/util/shared.c
+++ b/src/util/shared.c
@@ -170,6 +170,14 @@ void print_date_time(time_t mills, char buf[13]) {
snprintf(buf + n, 13 - n, "%d %02d:%02d ", info->tm_mday, info->tm_hour, info->tm_sec);
}
+void print_file_path(char* path) {
+ if (streql("-", path)) {
+ printf("(standard input)");
+ } else {
+ printf("%s", path);
+ }
+}
+
#ifndef MAJOR
#define MAJOR 0
#endif
diff --git a/src/util/shared.h b/src/util/shared.h
index 26e27c3..07da4a7 100644
--- a/src/util/shared.h
+++ b/src/util/shared.h
@@ -52,6 +52,7 @@ bool prefix(const char* pre, const char* str);
void print_file_size(size_t bytes, char buf[5]);
void print_date_time(time_t mills, char buf[13]);
+void print_file_path(char* path);
#define UNUSED(x) (void)(x)
#define ARG_UNUSED 0