From 68c67aa5e83521aa2f46b73342c4e5663c65ec1f Mon Sep 17 00:00:00 2001 From: Albert S Date: Sun, 19 Mar 2017 09:53:04 +0100 Subject: [PATCH] set argv[0] even if we do not pass anything else to the script --- adhocify.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/adhocify.c b/adhocify.c index 2631e05..b5e73ac 100644 --- a/adhocify.c +++ b/adhocify.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016 + * Copyright (c) 2014-2017 Albert S. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -587,7 +587,8 @@ void parse_options(int argc, char **argv) } prog = argv[optind++]; - if(optind < argc) + + if(optind <= argc) { fill_script_arguments(argc - optind, &argv[optind]); }