procroller: don't recurse on argv[0], whoops

This commit is contained in:
nick black 2020-05-22 09:16:41 -04:00
parent 24dae2cf15
commit ba8d80d444
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -37,7 +37,7 @@ eofcb(struct ncfdplane* ncfd, int nerrno, void* curry){
int main(int argc, char** argv){ int main(int argc, char** argv){
if(argc < 2){ if(argc < 2){
fprintf(stderr, "usage: procroller binary [ args... ]\n"); fprintf(stderr, "usage: %s binary [ args... ]\n", *argv);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
@ -49,6 +49,7 @@ int main(int argc, char** argv){
if(nc == NULL){ if(nc == NULL){
return EXIT_FAILURE; return EXIT_FAILURE;
} }
++argv;
struct ncplane* n = notcurses_stdplane(nc); struct ncplane* n = notcurses_stdplane(nc);
ncsubproc_options nopts = {}; ncsubproc_options nopts = {};
struct ncsubproc* nsproc = ncsubproc_createvp(n, &nopts, *argv, argv, cb, eofcb); struct ncsubproc* nsproc = ncsubproc_createvp(n, &nopts, *argv, argv, cb, eofcb);