Ok, my mistake. I see that the following two lines eventually call
/bin/sh with the -c parameter correctly:
argv[0] = shell;
execvp(shell, argv);
This replaces argv[0] with /bin/sh, sorry for the confusion. I posted
prematurely.
-Matt