chiark / gitweb /
tree-wide: remove Lennart's copyright lines
[elogind.git] / src / basic / terminal-util.c
index f6dff6d3562404fb038eb9c94e019de1791191a3..480c72e8dd4b975e0aac159b9091bf0a41109c8e 100644 (file)
@@ -1,9 +1,4 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-***/
 
 #include <errno.h>
 #include <fcntl.h>
@@ -1395,16 +1390,21 @@ int terminal_urlify_path(const char *path, const char *text, char **ret) {
 
 static int cat_file(const char *filename, bool newline) {
         _cleanup_fclose_ FILE *f = NULL;
+        _cleanup_free_ char *urlified = NULL;
         int r;
 
         f = fopen(filename, "re");
         if (!f)
                 return -errno;
 
+        r = terminal_urlify_path(filename, NULL, &urlified);
+        if (r < 0)
+                return r;
+
         printf("%s%s# %s%s\n",
                newline ? "\n" : "",
                ansi_highlight_blue(),
-               filename,
+               urlified,
                ansi_normal());
         fflush(stdout);