Improve the way base64 mode is enabled based on the program name,
so that it works when the path to b64encode is used to run it.
This commit is contained in:
parent
7031dac23d
commit
2441656486
@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <libgen.h>
|
||||
#include <resolv.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -83,7 +84,7 @@ main(int argc, char *argv[])
|
||||
base64 = 0;
|
||||
outfile = NULL;
|
||||
|
||||
if (strcmp(argv[0], "b64encode") == 0)
|
||||
if (strcmp(basename(argv[0]), "b64encode") == 0)
|
||||
base64 = 1;
|
||||
|
||||
while ((ch = getopt(argc, argv, "mo:")) != -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user