Re: [PATCH v2 1/7] util: introduce a parser for kernel cmdline arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 10/06/20 15:55, Paulo de Rezende Pinatti wrote:

+    { " arg3\" escaped=val2\"",                         "arg3\" escaped", "val2",                "" },

^Is this even valid for the kernel itself? Looking at [1], they clearly don't
allow escaped \" in the arg/value.

[1] https://github.com/torvalds/linux/blob/db54615e21419c3cb4d699a0b0aa16cc44d0e9da/lib/cmdline.c


I guess the word "escaped" in this test is a bit misleading; it's actually escaping the blank space, not the quote itself. This is valid for the kernel. In order to assure our parsing results would match those of the kernel I executed the code in cmdline.c in a standalone file to generate the reference values for the test.

I'll change "arg3\" escaped" to "arg3\" with spaces" to clearly state the intention here.


I forgot to mention that while double checking the reference values I had to add a missing trailing double quote to the expected result value in order to match what the kernel produces for this case. So this is actually "val2\"".

--
Best regards,

Paulo de Rezende Pinatti





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux