is not ok, of course. INIT_LIST_HEAD, list_for_each and list_entry_const are Linux functions. logdir functions I could not reproduced in a test app or write here because has many dependencies ... and to be everything more complicated, all this code is written in a recursive function .... is quite difficult to reproduced this situation in a test app ... I am trying to explore logdir function to see what I find there ...
If you tried separating the tokens using a space as the delimiter, an issue that I see is that the path\executable name can itself contain a space. This is usually resolved by surrounding that token with quotes. So as you are parsing the whole string, you'd need to keep track of whether you were in a quote or not. If so, then spaces do not count.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles