ipset-translate: allow invoking with a path name
PATCH 1/1 ipset-translate: allow invoking with a path name
Signed-off-by Quentin Armitage <[email protected]>
--- src/ipset.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
src/ipset.c +3 -1
@@ -6,6 +6,8 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#define _GNU_SOURCE +#include <assert.h> /* assert */ #include <stdio.h> /* fprintf */ #include <stdlib.h> /* exit */
@@ -31,7 +33,7 @@ main(int argc, char *argv[])exit (1 ); } -if (!strcmp (argv[0 ],"ipset-translate" )) { +if (!strcmp (basename (argv[0 ]),"ipset-translate" )) { ret =ipset_xlate_argv (ipset, argc, argv); }else { ret =ipset_parse_argv (ipset, argc, argv);
Signature · 1 line
2.34.3
Applied, thanks.
Quoted 30 lines · Quentin Armitage
Signed-off-by Quentin Armitage <[email protected]>--- src/ipset.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)src/ipset.c +3
-1@@ -6,6 +6,8 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#define _GNU_SOURCE +#include <assert.h> /* assert */ #include <stdio.h> /* fprintf */ #include <stdlib.h> /* exit */ @@ -31,7 +33,7 @@ main(int argc, char *argv[])exit (1 ); } -if (!strcmp (argv[0 ],"ipset-translate" )) { +if (!strcmp (basename (argv[0 ]),"ipset-translate" )) { ret =ipset_xlate_argv (ipset, argc, argv); }else { ret =ipset_parse_argv (ipset, argc, argv);Signature · 1 line
2.34.3