extract_broken_archive = FALSE;
decode_macbinary_contents = FALSE;
+ sort_contents = TRUE;
+ recursive_archiving = TRUE;
+ dump_lzss = FALSE;
}
/* ------------------------------------------------------------------------ */
LHa for UNIX V 1.00 Copyright(C) 1992 Masaru Oki\n\
LHa for UNIX V 1.14 Modified 1995 Nobutaka Watazaki\n\
LHa for UNIX V 1.14i Modified 2000 Tsugio Okamoto\n\
+LHA-PMA for UNIX V 2 PMA added 2000 Maarten ter Huurne\n\
Autoconfiscated 2001-2008 Koji Arai\n\
");
ARCHIVE_KANJI_CODE_OPTION,
TRADITIONAL_BEHAVIOR,
IGNORE_MAC_FILES,
+ DEBUG_OPTION,
};
struct option long_options[] = {
{"convert-filename-case", no_argument, &convertcase, TRUE},
{"traditional", no_argument, 0, TRADITIONAL_BEHAVIOR},
{"ignore-mac-files", no_argument, 0, IGNORE_MAC_FILES},
+ {"debug", required_argument, 0, DEBUG_OPTION},
{0, 0, 0, 0}
};
int i;
exclude_files[i+3] = 0;
break;
+ case DEBUG_OPTION:
+ if (!optarg) {
+ error("debugging item is not specified for --%s",
+ long_options[option_index].name);
+ return -1;
+ }
+ if (strcmp(optarg, "nosort") == 0) {
+ sort_contents = FALSE;
+ }
+ else if (strcmp(optarg, "norecursion") == 0) {
+ recursive_archiving = FALSE;
+ }
+ else if (strcmp(optarg, "dumplzss") == 0) {
+ dump_lzss = TRUE;
+ quiet = TRUE;
+ }
+ else {
+ error("unknown debugging item \"%s\" for --%s",
+ optarg, long_options[option_index].name);
+ return -1;
+ }
+ break;
+
default:
error("unknown option `-%c'.", c);
return -1;
static void
sort_files()
{
- if (cmd_filec > 1)
+ if (cmd_filec > 1 && sort_contents)
qsort(cmd_filev, cmd_filec, sizeof(char *), sort_by_ascii);
}
}
closedir(dirp);
finish_sp(&sp, v_filec, v_filev);
- if (*v_filec > 1)
+ if (*v_filec > 1 && sort_contents)
qsort(*v_filev, *v_filec, sizeof(char *), sort_by_ascii);
cleaning_files(v_filec, v_filev);