]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/journal/catalog.c
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / journal / catalog.c
index 886f6efd8bd2da917f24b75c36c6843accdfd56a..6775535b173f478d9809ab9fa6c4c752cda2f2a9 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -216,7 +217,7 @@ int catalog_file_lang(const char* filename, char **lang) {
                 return 0;
 
         beg = end - 1;
-        while (beg > filename && *beg != '.' && *beg != '/' && end - beg < 32)
+        while (beg > filename && !IN_SET(*beg, '.', '/') && end - beg < 32)
                 beg--;
 
         if (*beg != '.' || end <= beg + 1)
@@ -312,7 +313,7 @@ int catalog_import_file(Hashmap *h, const char *path) {
                     line[0] == '-' &&
                     line[1] == '-' &&
                     line[2] == ' ' &&
-                    (line[2+1+32] == ' ' || line[2+1+32] == '\0')) {
+                    IN_SET(line[2+1+32], ' ', '\0')) {
 
                         bool with_language;
                         sd_id128_t jd;
@@ -479,7 +480,7 @@ int catalog_update(const char* database, const char* root, const char* const* di
                 goto finish;
         }
 
-        r = conf_files_list_strv(&files, ".catalog", root, dirs);
+        r = conf_files_list_strv(&files, ".catalog", root, 0, dirs);
         if (r < 0) {
                 log_error_errno(r, "Failed to get catalog files: %m");
                 goto finish;