I am writing a C++ function on Linux which uses execvp. The only parameter passed to this function is a char* which indicates the arguments for exec. I need to convert this char* to a char** for execvp and I need to take into account quotations, here is an example:
/path/to/program "argument one" argument two
- results in -
/path/to/program
argument one
argument
two
Is there some built-in method for doing this? if not, is there something simpler I can do short of writing my own parser?