Skip to content

Commit

Permalink
Exclude long options if HAVE_GETOPT_H is undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlopezroche committed Jul 20, 2018
1 parent cb92c19 commit ca95a01
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fdupes.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <dirent.h>
#include <unistd.h>
#include <stdlib.h>
#ifndef OMIT_GETOPT_LONG
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#include <errno.h>
Expand Down Expand Up @@ -1054,7 +1054,7 @@ void help_text()
printf(" -i --reverse \treverse order while sorting\n");
printf(" -v --version \tdisplay fdupes version\n");
printf(" -h --help \tdisplay this help message\n\n");
#ifdef OMIT_GETOPT_LONG
#ifndef HAVE_GETOPT_H
printf("Note: Long options are not supported in this fdupes build.\n\n");
#endif
}
Expand All @@ -1072,8 +1072,9 @@ int main(int argc, char **argv) {
int progress = 0;
char **oldargv;
int firstrecurse;
char *logfile = 0;

#ifndef OMIT_GETOPT_LONG
#ifdef HAVE_GETOPT_H
static struct option long_options[] =
{
{ "omitfirst", 0, 0, 'f' },
Expand Down Expand Up @@ -1114,7 +1115,7 @@ int main(int argc, char **argv) {
oldargv = cloneargs(argc, argv);

while ((opt = GETOPT(argc, argv, "frRq1SsHlnAdPvhNImpo:i"
#ifndef OMIT_GETOPT_LONG
#ifdef HAVE_GETOPT_H
, long_options, NULL
#endif
)) != EOF) {
Expand Down

0 comments on commit ca95a01

Please sign in to comment.