("[Desktop Entry]\n"
"Hidden=\t true\n"),
+ ("[Desktop Entry]\n"
+ "Hidden=\t True\n"),
};
static void test_xdg_desktop_parse_one(unsigned i, const char *s) {
assert_se(streq(service->exec_string, "a"));
break;
case 2:
+ case 3:
assert_se(service->hidden);
break;
}
#include "conf-parser.h"
#include "escape.h"
-#include "unit-name.h"
-#include "path-util.h"
#include "fd-util.h"
#include "generator.h"
#include "log.h"
+#include "nulstr-util.h"
+#include "parse-util.h"
+#include "path-util.h"
#include "specifier.h"
#include "string-util.h"
-#include "nulstr-util.h"
#include "strv.h"
+#include "unit-name.h"
XdgAutostartService* xdg_autostart_service_free(XdgAutostartService *s) {
if (!s)
void *userdata) {
bool *b = ASSERT_PTR(data);
+ int r;
assert(filename);
assert(lvalue);
assert(rvalue);
- if (streq(rvalue, "true"))
- *b = true;
- else if (streq(rvalue, "false"))
- *b = false;
- else
+ r = parse_boolean(rvalue);
+ if (r < 0)
return log_syntax(unit, LOG_ERR, filename, line, SYNTHETIC_ERRNO(EINVAL), "Invalid value for boolean: %s", rvalue);
-
+ *b = r;
return 0;
}