]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/udev/udev-builtin.c
tree-wide: replace strv_split_full() with strv_split_extract() everywhere
[thirdparty/systemd.git] / src / udev / udev-builtin.c
index b41fbfc39a9436de1d89ed387e30b6889eef16d5..ac443d66e63665659fb68971272e06cda8309696 100644 (file)
@@ -109,6 +109,7 @@ UdevBuiltinCommand udev_builtin_lookup(const char *command) {
 
 int udev_builtin_run(sd_device *dev, UdevBuiltinCommand cmd, const char *command, bool test) {
         _cleanup_strv_free_ char **argv = NULL;
+        int r;
 
         assert(dev);
         assert(cmd >= 0 && cmd < _UDEV_BUILTIN_MAX);
@@ -117,9 +118,10 @@ int udev_builtin_run(sd_device *dev, UdevBuiltinCommand cmd, const char *command
         if (!builtins[cmd])
                 return -EOPNOTSUPP;
 
-        argv = strv_split_full(command, NULL, SPLIT_QUOTES | SPLIT_RELAX);
-        if (!argv)
-                return -ENOMEM;
+        r = strv_split_extract(&argv, command, NULL,
+                               EXTRACT_UNQUOTE | EXTRACT_RELAX | EXTRACT_RETAIN_ESCAPE);
+        if (r < 0)
+                return r;
 
         /* we need '0' here to reset the internal state */
         optind = 0;