summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-07 02:16:14 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-07 02:21:42 +0200
commited4c1cc672560b72aa1c5a74cd692a65811dd589 (patch)
tree1034875738ed245b146ba64717ce558c83690246
parent9aab5a731db87f96101c2eb5d2b15ac45c3a33c3 (diff)
unit: when reading description from LSB prefer short over long description
-rw-r--r--src/service.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/service.c b/src/service.c
index d689734164..c9abb08670 100644
--- a/src/service.c
+++ b/src/service.c
@@ -457,7 +457,8 @@ static int service_load_sysv_path(Service *s, const char *path) {
s->sysv_runlevels = d;
}
- } else if (startswith_no_case(t, "description:")) {
+ } else if (startswith_no_case(t, "description:") &&
+ !u->meta.description) {
size_t k = strlen(t);
char *d;
@@ -603,9 +604,13 @@ static int service_load_sysv_path(Service *s, const char *path) {
s->sysv_runlevels = d;
}
- } else if (startswith_no_case(t, "Description:")) {
+ } else if (startswith_no_case(t, "Description:") &&
+ !u->meta.description) {
char *d;
+ /* We use the long description only if
+ * no short description is set. */
+
state = LSB_DESCRIPTION;
if (!(d = strdup(strstrip(t+12)))) {
@@ -616,13 +621,9 @@ static int service_load_sysv_path(Service *s, const char *path) {
free(u->meta.description);
u->meta.description = d;
- } else if (startswith_no_case(t, "Short-Description:") &&
- !u->meta.description) {
+ } else if (startswith_no_case(t, "Short-Description:")) {
char *d;
- /* We use the short description only
- * if no long description is set. */
-
state = LSB;
if (!(d = strdup(strstrip(t+18)))) {