Merge pull request #60 from jrblixt/clu_linuxPathFix

Fix for CLU paths on case sensitive systems.
pull/64/head
Kaleb Himes 2017-06-06 11:02:39 -06:00 committed by GitHub
commit b1ff5c8c85
1 changed files with 19 additions and 4 deletions

View File

@ -31,24 +31,39 @@
int main(int argc, char** argv)
{
int ret = 0, option = 0, long_index = 0;
int i;
int ret = 0;
int option = 0;
int ignoreIn = 0;
int ignoreOut = 0;
int long_index = 0;
int i;
if (argc == 1) {
printf("Main Help.\n");
wolfCLU_help();
}
/* Set ignore variables for -in and -out files */
ret = wolfCLU_checkForArg("-in", 3, argc, argv);
if (ret > 0) {
ignoreIn = ret + 1;
}
ret = wolfCLU_checkForArg("-out", 4, argc, argv);
if (ret > 0) {
ignoreOut = ret + 1;
}
/* flexibility: allow users to input any CAPS or lower case,
* we will do all processing on lower case only. */
for (i = 0; i < argc; i++) {
convert_to_lower(argv[i], (int) XSTRLEN(argv[i]));
if (i != ignoreIn && i != ignoreOut) {
convert_to_lower(argv[i], (int) XSTRLEN(argv[i]));
}
}
while ((option = getopt_long_only(argc, argv,"",
long_options, &long_index )) != -1) {
switch (option) {
/* Encrypt */
case ENCRYPT: ret = wolfCLU_setup(argc, argv, 'e');