Pārlūkot izejas kodu

ncd/modules/run.c: support non-ContinuousString strings

ambrop7 13 gadi atpakaļ
vecāks
revīzija
da139c0a3e
1 mainītis faili ar 5 papildinājumiem un 3 dzēšanām
  1. 5 3
      ncd/modules/run.c

+ 5 - 3
ncd/modules/run.c

@@ -114,8 +114,9 @@ static int build_cmdline (NCDModuleInst *i, NCDValRef args, int remove, char **e
             goto fail2;
         }
         
-        if (!CmdLine_AppendNoNull(cl, NCDVal_StringData(arg), NCDVal_StringLength(arg))) {
-            ModuleLog(i, BLOG_ERROR, "CmdLine_AppendNoNull failed");
+        b_cstring arg_cstr = NCDVal_StringCstring(arg);
+        if (!CmdLine_AppendCstring(cl, arg_cstr, 0, arg_cstr.length)) {
+            ModuleLog(i, BLOG_ERROR, "CmdLine_AppendCstring failed");
             goto fail2;
         }
     }
@@ -174,7 +175,8 @@ static struct NCDModule modules[] = {
         .type = "run",
         .func_new2 = func_new,
         .func_die = func_die,
-        .alloc_size = sizeof(struct instance)
+        .alloc_size = sizeof(struct instance),
+        .flags = NCDMODULE_FLAG_ACCEPT_NON_CONTINUOUS_STRINGS
     }, {
         .type = NULL
     }