chiark / gitweb /
Prep v239: terminal-util.[hc] - Mask new 'urlify' functions, we do not need them.
[elogind.git] / src / basic / terminal-util.c
index f6dff6d3562404fb038eb9c94e019de1791191a3..f8623f9fdac777b1e1f57034c7821566af8a8b2f 100644 (file)
@@ -1,16 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-***/
 
 #include <errno.h>
 #include <fcntl.h>
 #include <limits.h>
-//#include <linux/kd.h>
-//#include <linux/tiocl.h>
-//#include <linux/vt.h>
+#include <linux/kd.h>
+#include <linux/tiocl.h>
+#include <linux/vt.h>
 //#include <poll.h>
 //#include <signal.h>
 #include <stdarg.h>
@@ -1302,6 +1297,7 @@ int vt_reset_keyboard(int fd) {
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 static bool urlify_enabled(void) {
         static int cached_urlify_enabled = -1;
 
@@ -1395,16 +1391,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);
 
@@ -1468,3 +1469,4 @@ void print_separator(void) {
         } else
                 fputs("\n\n", stdout);
 }
+#endif // 0