]> err.no Git - systemd/commitdiff
debian: Prefix welcome string with "Debian "
authorMichael Biebl <biebl@debian.org>
Tue, 21 Dec 2010 02:07:36 +0000 (03:07 +0100)
committerMichael Biebl <biebl@debian.org>
Tue, 21 Dec 2010 02:07:36 +0000 (03:07 +0100)
For stable releases /etc/debian_version only contains a version number,
so we add a prefix "Debian ".

src/util.c

index 0cd78f6561e9b03633e9b97567d0b38e6c31eb0e..d12b5e772da601b9379e0c0efde09481564d7a56 100644 (file)
@@ -3047,12 +3047,16 @@ void status_welcome(void) {
 #elif defined(TARGET_DEBIAN)
 
         if (!pretty_name) {
-                if ((r = read_one_line_file("/etc/debian_version", &pretty_name)) < 0) {
+                char *version;
+                if ((r = read_one_line_file("/etc/debian_version", &version)) < 0) {
 
                         if (r != -ENOENT)
                                 log_warning("Failed to read /etc/debian_version: %s", strerror(-r));
-                } else
-                        truncate_nl(pretty_name);
+                } else {
+                        truncate_nl(version);
+                        pretty_name = strappend("Debian ", version);
+                        free(version);
+                }
         }
 
         if (!ansi_color)