version 1.77, 2015/04/03 12:52:48 |
version 1.78, 2015/04/05 13:54:06 |
|
|
#include "file.h" |
#include "file.h" |
#include "sort.h" |
#include "sort.h" |
|
|
#define OPTIONS "bCcdfgHhik:Mmno:RrS:st:T:uVz" |
#ifdef GNUSORT_COMPATIBILITY |
|
# define PERMUTE "" |
|
#else |
|
# define PERMUTE "+" |
|
#endif |
|
#define OPTIONS PERMUTE"bCcdfgHhik:Mmno:RrS:st:T:uVz" |
|
|
static bool need_random; |
static bool need_random; |
static const char *random_source; |
static const char *random_source; |
|
|
char *outfile, *real_outfile, *sflag; |
char *outfile, *real_outfile, *sflag; |
int c; |
int c; |
size_t i; |
size_t i; |
|
struct sort_mods *sm = &default_sort_mods_object; |
bool mef_flags[NUMBER_OF_MUTUALLY_EXCLUSIVE_FLAGS] = |
bool mef_flags[NUMBER_OF_MUTUALLY_EXCLUSIVE_FLAGS] = |
{ false, false, false, false, false, false }; |
{ false, false, false, false, false, false }; |
|
|
|
|
real_outfile = NULL; |
real_outfile = NULL; |
sflag = NULL; |
sflag = NULL; |
|
|
struct sort_mods *sm = &default_sort_mods_object; |
|
|
|
init_tmp_files(); |
init_tmp_files(); |
|
|
set_signal_handler(); |
set_signal_handler(); |
|
|
} |
} |
} |
} |
} |
} |
|
|
argc -= optind; |
argc -= optind; |
argv += optind; |
argv += optind; |
|
|
|
#ifndef GNUSORT_COMPATIBILITY |
|
if (argc > 2 && strcmp(argv[argc - 2], "-o") == 0) { |
|
outfile = argv[argc - 1]; |
|
argc -= 2; |
|
} |
|
#endif |
|
|
if (sort_opts_vals.cflag && argc > 1) |
if (sort_opts_vals.cflag && argc > 1) |
errx(2, "only one input file is allowed with the -%c flag", |
errx(2, "only one input file is allowed with the -%c flag", |