Add couple of mozilla file extensions.

Check for files > INT64_T when sorting.
Makefile targets to help development.
This commit is contained in:
Moinak Ghosh 2014-11-15 19:17:33 +05:30
parent cfe2cea544
commit 29b5efc988
6 changed files with 24 additions and 10 deletions

View file

@ -435,10 +435,12 @@ $(PROG): $(LIB) $(PROGOBJS) ./buildtmp/$(PROG)
test: all
(cd test; ulimit -c unlimited; sh ./run_test.sh $(TESTSUITE) ) 2>&1 | tee test.log
clean:
topclean:
$(RM) buildtmp/$(PROG) $(OBJS) $(PROGOBJS) $(BAKFILES) $(LIB) $(LIB).$(LIBVER)
$(RM) test.log
$(RM_RF) test/datafiles
clean: topclean
(cd @LIBARCHIVE_DIR@; make clean)
[ "x@ENABLE_WAVPACK@" != "x" ] && (cd @WAVPACK_DIR@; make clean)
exit 0

View file

@ -645,6 +645,14 @@ add_pathname(const char *fpath, const struct stat *sb,
int i;
char *dot;
/*
* Paranoid check (Well, we can have a sparse file of any size ...).
* When sorting pathnames, we can't handle files close to INT64_MAX size.
*/
if (sb->st_size > INT64_MAX - 255) {
log_msg(LOG_ERR, 0, "%s:\nCannot handle files > %lld bytes when sorting!",
fpath, INT64_MAX - 255);
}
basename = &fpath[ftwbuf->base];
if (a_state.srt_pos == SORT_BUF_SIZE) {
struct sort_buf *srt;

View file

@ -227,5 +227,7 @@ struct ext_entry {
{"sed" , TYPE_TEXT, 3},
{"mailmap" , TYPE_TEXT, 7},
{"sin" , TYPE_BINARY, 3},
{"xul" , TYPE_TEXT, 3},
{"xpt" , TYPE_BINARY, 3},
};
#endif

View file

@ -217,3 +217,5 @@ charset,TYPE_TEXT
sed,TYPE_TEXT
mailmap,TYPE_TEXT
sin,TYPE_BINARY
xul,TYPE_TEXT
xpt,TYPE_BINARY

View file

@ -12,14 +12,14 @@
/* small adjustments to _a_ to make values distinct */
ub1 tab[] = {
0,0,87,120,113,125,22,125,0,0,0,220,125,0,131,7,
0,0,183,125,82,113,0,131,146,87,125,183,0,7,146,183,
0,0,0,253,183,0,131,113,253,168,0,220,0,7,0,113,
82,0,7,131,145,7,0,0,120,113,0,183,220,183,220,22,
0,183,0,183,113,0,183,120,22,27,125,125,233,124,125,235,
253,131,146,235,15,220,0,235,0,235,212,220,220,220,183,132,
87,125,113,82,220,32,229,235,131,27,0,220,237,113,4,132,
0,0,145,0,148,195,0,253,142,88,66,232,137,135,167,0,
0,0,87,235,113,131,120,120,113,85,0,220,125,0,131,7,
0,0,183,125,82,183,0,131,253,125,125,183,0,7,85,183,
0,0,0,145,183,0,131,113,253,183,0,220,0,7,0,113,
82,0,7,113,125,220,0,0,168,113,0,183,220,183,220,22,
0,183,0,235,113,0,183,82,22,27,125,253,142,124,125,235,
232,131,146,235,146,220,0,235,0,220,220,220,113,220,183,135,
87,125,113,220,220,32,229,97,131,40,0,184,237,113,148,184,
0,0,145,0,241,167,0,145,88,88,184,242,57,135,174,0,
};
/* The hash function */

View file

@ -8,7 +8,7 @@
extern ub1 tab[];
#define PHASHLEN 0x80 /* length of hash mapping table */
#define PHASHNKEYS 216 /* How many keys were hashed */
#define PHASHNKEYS 218 /* How many keys were hashed */
#define PHASHRANGE 256 /* Range any input might map to */
#define PHASHSALT 0x9e3779b9 /* internal, initialize normal hash */