--- arj-git-6af974651.old/arj_arcv.c +++ arj-git-6af974651/arj_arcv.c @@ -726,8 +726,16 @@ else { hput_longword(resume_position); - hput_longword(ts_native(&atime_stamp, host_os)); - hput_longword(ts_native(&ctime_stamp, host_os)); + if(ts_valid(secondary_ftime)) + { + hput_longword(ts_native(&secondary_ftime, host_os)); + hput_longword(ts_native(&secondary_ftime, host_os)); + } + else + { + hput_longword(ts_native(&atime_stamp, host_os)); + hput_longword(ts_native(&ctime_stamp, host_os)); + } hput_longword(0L); } } @@ -913,13 +921,13 @@ else { strcat(tmp_comment, tmp_cmtline); - strcat(tmp_comment, lf); + strcat(tmp_comment, "\n"); } } else { strcat(tmp_comment, tmp_cmtline); - strcat(tmp_comment, lf); + strcat(tmp_comment, "\n"); } } } @@ -1846,7 +1854,7 @@ raw_eh=eh_lookup(eh, UXSPECIAL_ID)->raw; uxspecial_stats(raw_eh, UXSTATS_SHORT); } - msg_cprintf(0, lf); + msg_cprintf(0, "\n"); } if(err_id==0&&user_wants_fail) { @@ -2523,9 +2531,9 @@ { msg_cprintf(0, (FMSG *)strform, misc_buf); if(search_mode==SEARCH_DEFAULT) - msg_cprintf(0, (FMSG *)lf); + msg_cprintf(0, "\n"); if(search_mode==SEARCH_BRIEF) - msg_cprintf(0, (FMSG *)cr); + msg_cprintf(0, "\r"); } for(pattern=0; pattern #include "arj.h" DEBUGHDR(__FILE__) /* Debug information block */ @@ -929,9 +930,9 @@ #endif fclose(stream); #if SFX_LEVEL>=ARJSFXV - return(crc32term==st_crc&&fsize==st_fsize); + return((uint32_t)crc32term==(uint32_t)st_crc&&(uint32_t)fsize==(uint32_t)st_fsize); #else - if(crc32term==st_crc&&fsize==st_fsize) + if((uint32_t)crc32term==(uint32_t)st_crc&&(uint32_t)fsize==(uint32_t)st_fsize) msg_cprintf(0, M_INTEGRITY_OK); else pause_error(M_INTEGRITY_VIOLATED); --- arj-git-6af974651.old/arj_user.c +++ arj-git-6af974651/arj_user.c @@ -1059,7 +1059,7 @@ if(recover_file(tmp_archive_name, nullstr, tmp_tmp_filename, protected, eof_pos)) { msg_cprintf(H_HL, M_CANT_FIND_DAMAGE, archive_name); - printf(lf); + printf("\n"); } else { @@ -1294,7 +1294,7 @@ if(recover_file(archive_name, nullstr, nullstr, protected, eof_pos)) { msg_cprintf(H_HL, M_CANT_FIND_DAMAGE, archive_name); - printf(lf); + printf("\n"); } else { @@ -1327,7 +1327,7 @@ msg_cprintf(0, M_CHAPTERS_ON); else if(chapter_mode==CHAP_REMOVE) msg_cprintf(0, M_CHAPTERS_OFF); - msg_cprintf(0, strform, lf); + msg_cprintf(0, strform, "\n"); } if(cmd==ARJ_CMD_COPY&&protfile_option&&!arjprot_tail) msg_cprintf(0, M_ARJPROT_DISABLED); @@ -2303,7 +2303,7 @@ timestamp_to_str(timetext, &ftime_stamp); msg_cprintf(H_HL|H_NFMT, M_ARCHIVE_CREATED, timetext); if(show_ansi_comments) - printf(cmt_ptr); + fputs(cmt_ptr, stdout); else display_comment(cmt_ptr); /* The sfx_setup() occurs here */ --- arj-git-6af974651.old/arjdisp.c +++ arj-git-6af974651/arjdisp.c @@ -20,8 +20,6 @@ static long compsize; static char cmd_verb; static char msg_lf[]="\n"; -char strform[]="%s"; /* Export it for scrnio.c, too - (a byte saved is a byte gained) */ /* Pseudographical controls */ @@ -54,19 +52,19 @@ textcolor(7); clrscr(); gotoxy(2, 2); - scrprintf(win_top); + fputs(win_top, stdout); for(i=3; i<24; i++) { - gotoxy(2, i); scrprintf(win_border); - gotoxy(79, i); scrprintf(win_border); + gotoxy(2, i); fputs(win_border, stdout); + gotoxy(79, i); fputs(win_border, stdout); } - gotoxy(2, 24); scrprintf(win_bottom); + gotoxy(2, 24); fputs(win_bottom, stdout); gotoxy(10, 5); - scrprintf(M_ARJDISP_COPYRIGHT); + fputs(M_ARJDISP_COPYRIGHT, stdout); gotoxy(10, 6); - scrprintf(M_ARJDISP_DISTRIBUTION); + fputs(M_ARJDISP_DISTRIBUTION, stdout); gotoxy(10, 7); - scrprintf(M_ARJDISP_LICENSE); + fputs(M_ARJDISP_LICENSE, stdout); gotoxy(16, 10); scrprintf(M_PROCESSING_ARCHIVE, archive_name); t=strtok(M_ARJDISP_INFO, msg_lf); @@ -74,11 +72,11 @@ while(t!=NULL&&i<=23) { gotoxy(10, i++); - scrprintf(strform, t); + scrprintf("%s", t); t=strtok(NULL, msg_lf); } gotoxy(16, 20); - scrprintf(M_PRESS_ANY_KEY); + fputs(M_PRESS_ANY_KEY, stdout); uni_getch(); gotoxy(1, 24); } @@ -96,19 +94,19 @@ { clrscr(); gotoxy(2, 2); - scrprintf(win_top); + fputs(win_top, stdout); for(i=3; i<24; i++) { - gotoxy(2, i); scrprintf(win_border); - gotoxy(79, i); scrprintf(win_border); + gotoxy(2, i); fputs(win_border, stdout); + gotoxy(79, i); fputs(win_border, stdout); } - gotoxy(2, 24); scrprintf(win_bottom); + gotoxy(2, 24); fputs(win_bottom, stdout); gotoxy(10, 5); - scrprintf(M_ARJDISP_COPYRIGHT); + fputs(M_ARJDISP_COPYRIGHT, stdout); gotoxy(10, 6); - scrprintf(M_ARJDISP_DISTRIBUTION); + fputs(M_ARJDISP_DISTRIBUTION, stdout); gotoxy(10, 7); - scrprintf(M_ARJDISP_LICENSE); + fputs(M_ARJDISP_LICENSE, stdout); gotoxy(16, 10); scrprintf(M_PROCESSING_ARCHIVE, archive_name); gotoxy(16, 12); @@ -132,13 +130,13 @@ break; } gotoxy(15, 14); - scrprintf(ind_top); + fputs(ind_top, stdout); gotoxy(15, 15); - scrprintf(ind_middle); + fputs(ind_middle, stdout); gotoxy(15, 16); - scrprintf(ind_bottom); + fputs(ind_bottom, stdout); gotoxy(16, 18); - scrprintf(M_ARJDISP_CTR_START); + fputs(M_ARJDISP_CTR_START, stdout); } else { @@ -146,7 +144,7 @@ gotoxy(16, 15); memset(progress, indo, i); progress[i]='\0'; - scrprintf(progress); + fputs(progress, stdout); gotoxy(16, 18); scrprintf(M_ARJDISP_CTR, calc_percentage(bytes, uncompsize)/10); } @@ -165,19 +163,19 @@ textcolor(7); clrscr(); gotoxy(2, 2); - scrprintf(win_top); + fputs(win_top, stdout); for(i=3; i<24; i++) { - gotoxy(2, i); scrprintf(win_border); - gotoxy(79, i); scrprintf(win_border); + gotoxy(2, i); fputs(win_border, stdout); + gotoxy(79, i); fputs(win_border, stdout); } - gotoxy(2, 24); scrprintf(win_bottom); + gotoxy(2, 24); fputs(win_bottom, stdout); gotoxy(10, 5); - scrprintf(M_ARJDISP_COPYRIGHT); + fputs(M_ARJDISP_COPYRIGHT, stdout); gotoxy(10, 6); - scrprintf(M_ARJDISP_DISTRIBUTION); + fputs(M_ARJDISP_DISTRIBUTION, stdout); gotoxy(10, 7); - scrprintf(M_ARJDISP_LICENSE); + fputs(M_ARJDISP_LICENSE, stdout); gotoxy(16, 10); scrprintf(M_FINISHED_PROCESSING, archive_name); gotoxy(1, 24); --- arj-git-6af974651.old/arjsfx.c +++ arj-git-6af974651/arjsfx.c @@ -214,7 +214,7 @@ freopen(dev_con, m_w, stdout); #if SFX_LEVEL>=ARJSFXV if(ferror(stdout)) - msg_fprintf(stderr, M_DISK_FULL); + msg_fprintf(stderr, "Can't write file. Disk full?"); if(debug_enabled&&strchr(debug_opt, 't')!=NULL) { ticks=get_ticks()-ticks; --- arj-git-6af974651.old/decode.c +++ arj-git-6af974651/decode.c @@ -255,7 +255,7 @@ if(i==i_special) { c=getbits(2); - while(--c>=0) + while(--c>=0&&i=0) + while(--c>=0&&i=ARJSFXV if(!setjmp(decode_proc)) @@ -450,9 +450,12 @@ { j=c-(UCHAR_MAX+1-THRESHOLD); count-=(unsigned long)j; - i=r-decode_p()-1; + int P = decode_p(); + i=r-P-1; if(i<0) i+=DICSIZ; + if(i<0) + goto termination; if(r>i&&r=0) --- arj-git-6af974651.old/environ.c +++ arj-git-6af974651/environ.c @@ -1087,6 +1087,8 @@ if(action!=VALIDATE_DRIVESPEC) { #endif + while (name[0]!='\0'&& + (name[0]=='.'||name[0]==PATHSEP_DEFAULT||name[0]==PATHSEP_UNIX)) { if(name[0]=='.') { if(name[1]=='.'&&(name[2]==PATHSEP_DEFAULT||name[2]==PATHSEP_UNIX)) @@ -1096,6 +1098,7 @@ } if(name[0]==PATHSEP_DEFAULT||name[0]==PATHSEP_UNIX) name++; /* "\\" - revert to root */ + } #if SFX_LEVEL>=ARJSFXV } } @@ -1775,7 +1778,8 @@ memset(&flk, 0, sizeof(flk)); rc=fcntl(handle, F_GETLK, &flk); close(handle); - return(((rc==-1&&errno!=EINVAL)||(rc!=1&&flk.l_type==F_RDLCK))?-1:0); + return(((rc==-1&&errno!=EINVAL&&errno!=ENOSYS)|| + (rc!=1&&flk.l_type==F_RDLCK))?-1:0); #endif } #endif --- arj-git-6af974651.old/fardata.c +++ arj-git-6af974651/fardata.c @@ -52,7 +52,7 @@ /* Check if the message could have a standard error code */ if(errno!=0&&is_std_error(errmsg)) { - msg_cprintf(0, lf); + msg_cprintf(0, "\n"); error_report(); } #endif @@ -377,10 +377,10 @@ { #if SFX_LEVEL>=ARJSFXV fprintf(new_stdout, strform, n_text); - fprintf(new_stdout, lf); + fprintf(new_stdout, "\n"); #else printf(strform, n_text); - printf(lf); + printf("\n"); #endif } else @@ -391,13 +391,13 @@ #ifdef NEED_CRLF scr_out("\r"); #endif - scr_out(lf); + scr_out("\n"); } if(!no_colors) textcolor(color_table[ccode&H_COLORMASK].color); #else printf(strform, n_text); - printf(lf); + printf("\n"); #endif n_text=t_text+1; #if SFX_LEVEL>=ARJ --- arj-git-6af974651.old/gnu/configure.in +++ arj-git-6af974651/gnu/configure.in @@ -47,16 +47,13 @@ DLL_CFLAGS="-fPIC" case $host_os in -linux*) +gnu*|linux*|k*bsd*) AC_DEFINE(ELF_EXECUTABLES, 1, [Define if executables use ELF format]) DYN_LIBS="-ldl" + DLL_FLAGS="-shared -fPIC" + DLL_CFLAGS="-fPIC" LD_STRIP="gnu/stripgcc.lnk" ;; -k*bsd*) - AC_DEFINE(ELF_EXECUTABLES) - DYN_LIBS="-ldl" - LD_STRIP="gnu/stripgcc.lnk" - ;; *bsd*) AC_DEFINE(ELF_EXECUTABLES) DLL_FLAGS="-shared -export-dynamic" @@ -94,7 +91,7 @@ case $host_cpu in alpha*) - AC_DEFINE(ALIGN_POINTERS) + AC_DEFINE(ALIGN_POINTERS, 1, [Define if pointers need to be aligned]) ;; sparc*) AC_DEFINE(ALIGN_POINTERS) @@ -157,13 +154,14 @@ AC_SUBST(OUT_DIR) AC_MSG_CHECKING([fnmatch() tolerance to incomplete patterns acting as filenames]) -AC_RUN_IFELSE([ +AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include +]], [[ int main() { return(fnmatch("@<:@", "@<:@", 0)); /* Must return 0 for a valid match */ } -], [TOLERANT_FNMATCH=yes], [TOLERANT_FNMATCH=no], [TOLERANT_FNMATCH=cross]) +]])], [TOLERANT_FNMATCH=yes], [TOLERANT_FNMATCH=no], [TOLERANT_FNMATCH=cross]) if test x$TOLERANT_FNMATCH = xyes ; then AC_DEFINE(TOLERANT_FNMATCH, 1, [Trust fnmatch() when supplying incomplete patterns]) fi @@ -176,7 +174,7 @@ [color_output=yes], [color_output=no]) AC_MSG_RESULT($color_output) -test "$color_output" = "yes" && AC_DEFINE(USE_COLORS) +test "$color_output" = "yes" && AC_DEFINE(USE_COLORS, 1, [Define if colors should be used]) AC_SUBST(HAVE_MKDTEMP) AC_SUBST(HAVE_FCLOSEALL) --- arj-git-6af974651.old/gnu/makefile.in +++ arj-git-6af974651/gnu/makefile.in @@ -56,7 +56,9 @@ ADD_LDFLAGS = -s @LD_STRIP@ endif -ALL_CFLAGS += $(CFLAGS) +ARJ_TIMESTAMP = $(shell TZ=UTC0 date -d '@$(SOURCE_DATE_EPOCH)' '+%Y%m%d%H%S') + +ALL_CFLAGS += @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) # Build Installation paths @@ -80,11 +82,11 @@ # Definitions for compiling submodules LDFLAGS = @LDFLAGS@ $(ADD_LDFLAGS) -DLL_FLAGS = @DLL_FLAGS@ $(ADD_LDFLAGS) +DLL_FLAGS = $(LDFLAGS) @DLL_FLAGS@ DLL_CFLAGS = @DLL_CFLAGS@ REQUIRES_DEF = @REQUIRES_DEF@ -COPT = -c -I@OUT_DIR@ -I$(BASEDIR) -I$(SRC_DIR) @CFLAGS@ $(ALL_CFLAGS) +COPT = -c -I@OUT_DIR@ -I$(BASEDIR) -I$(SRC_DIR) $(ALL_CFLAGS) STD_COPT = -DARJUTIL $(COPT) ARJ_COPT = -DSFL=4 $(COPT) ARJSFXV_COPT = -DSFL=3 $(COPT) @@ -93,7 +95,7 @@ REARJ_COPT = -DREARJ $(COPT) REGISTER_COPT = -DREGISTER $(COPT) ARJDISP_COPT = -DARJDISP $(COPT) -ARJCRYPT_COPT = $(DLL_CFLAGS) $(COPT) +ARJCRYPT_COPT = $(COPT) $(DLL_CFLAGS) SFXSTUB_COPT = -DSFXSTUB $(COPT) # Linkage @@ -159,13 +161,15 @@ # Main dependency tree # -.PHONY: timestamp prepare cleanup package help +.PHONY: timestamp msg-headers depends prepare clean package help ifdef COMMERCIAL MAKE_KEY=$(TOOLS_DIR)/make_key$x endif all: prepare timestamp + $(MAKE) msg-headers + $(MAKE) depends $(MAKE) do-all do-all: \ @@ -175,8 +179,28 @@ $(REGISTER_DIR)/$(REGISTER)$x \ $(ARJDISP_DIR)/arjdisp$x \ $(TOOLS_DIR)/packager$x \ - $(MAKE_KEY) \ - dispose + $(MAKE_KEY) + +MSG_ID := \ + msg_crp msg_stb msg_sfv msg_sfx msg_sfj msg_arj msg_rej msg_reg msg_adi +MSG_HEADERS := $(patsubst %,$(BASEDIR)/%.h,$(MSG_ID)) + +msg-headers: $(MSG_HEADERS) + +.deps: + mkdir -p $@ + +.deps/%.d: %.c .deps + $(CC) $(COPT) $< -MM > $@ + +SOURCES = $(wildcard *.c) +DEPS = $(addprefix .deps/,$(SOURCES:.c=.d)) + +ifeq ($(sort $(DEPS)),$(sort $(wildcard .deps/*.d))) +include $(DEPS) +endif + +depends: $(DEPS) # # Update timestamp file @@ -186,12 +210,6 @@ $(TOOLS_DIR)/today$x $(LOCALE) $(BASEDIR) # -# Final cleanup -# - -dispose: - -# # The tools # @@ -254,7 +272,7 @@ $(ARJCRYPT_DIR)/arjcrypt$d: $(ARJCRYPT_OBJS) $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(DLL_FLAGS) -o $@ $(ARJCRYPT_OBJS) $(ARJCRYPT_DEF) $(LIBS) -$(BASEDIR)/nmsg_crp.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/nmsg_crp.c $(BASEDIR)/msg_crp.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_crp $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -267,7 +285,7 @@ $(SFXSTUB_DIR)/sfxstub$x: $(SFXSTUB_OBJS) $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(SFXSTUB_OBJS) $(LIBS) -$(BASEDIR)/nmsg_stb.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/nmsg_stb.c $(BASEDIR)/msg_stb.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_stb $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -284,7 +302,8 @@ $(ARJSFXV_DIR)/arjsfxv$x: $(ARJSFXV_OBJS) $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXV_OBJS) $(LIBS) $(DYN_LIBS) -$(BASEDIR)/fmsg_sfv.c $(BASEDIR)/imsg_sfv.c $(BASEDIR)/nmsg_sfv.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_sfv.c $(BASEDIR)/imsg_sfv.c $(BASEDIR)/nmsg_sfv.c \ +$(BASEDIR)/msg_sfv.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_sfv $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -300,7 +319,8 @@ $(ARJSFX_DIR)/arjsfx$x: $(ARJSFX_OBJS) $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFX_OBJS) $(LIBS) -$(BASEDIR)/fmsg_sfx.c $(BASEDIR)/imsg_sfx.c $(BASEDIR)/nmsg_sfx.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_sfx.c $(BASEDIR)/imsg_sfx.c $(BASEDIR)/nmsg_sfx.c \ +$(BASEDIR)/msg_sfx.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_sfx $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -314,7 +334,8 @@ $(ARJSFXJR_DIR)/arjsfxjr$x: $(ARJSFXJR_OBJS) $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXJR_OBJS) $(LIBS) -$(BASEDIR)/fmsg_sfj.c $(BASEDIR)/imsg_sfj.c $(BASEDIR)/nmsg_sfj.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_sfj.c $(BASEDIR)/imsg_sfj.c $(BASEDIR)/nmsg_sfj.c \ +$(BASEDIR)/msg_sfj.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_sfj $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -345,10 +366,11 @@ $(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(ARJSFXV_DIR)/arjsfxv$x $(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(SFXSTUB_DIR)/sfxstub$x rm -f $(BASEDIR)/help.arj - $(ARJ_DIR)/arj$x a $(BASEDIR)/help.arj -+ -t1f -2e -e -jm -jh65535 -jt $(RES_DIR)/$(LOCALE)/arj?.txt + TZ=UTC0 $(ARJ_DIR)/arj$x a $(BASEDIR)/help.arj -+ -t1f -2d -e -jm -jh65535 -jt -hdo$(ARJ_TIMESTAMP) $(RES_DIR)/$(LOCALE)/arj?.txt $(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(BASEDIR)/help.arj -$(BASEDIR)/fmsg_arj.c $(BASEDIR)/imsg_arj.c $(BASEDIR)/nmsg_arj.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_arj.c $(BASEDIR)/imsg_arj.c $(BASEDIR)/nmsg_arj.c \ +$(BASEDIR)/msg_arj.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_arj $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -365,7 +387,8 @@ $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REARJ_OBJS) $(LIBS) -$(BASEDIR)/fmsg_rej.c $(BASEDIR)/imsg_rej.c $(BASEDIR)/nmsg_rej.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_rej.c $(BASEDIR)/imsg_rej.c $(BASEDIR)/nmsg_rej.c \ +$(BASEDIR)/msg_rej.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_rej $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -380,7 +403,8 @@ $(TOOLS_DIR)/postproc$x $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REGISTER_OBJS) $(LIBS) -$(BASEDIR)/fmsg_reg.c $(BASEDIR)/imsg_reg.c $(BASEDIR)/nmsg_reg.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_reg.c $(BASEDIR)/imsg_reg.c $(BASEDIR)/nmsg_reg.c \ +$(BASEDIR)/msg_reg.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_reg $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -394,7 +418,8 @@ $(ARJDISP_DIR)/arjdisp$x: $(ARJDISP_OBJS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJDISP_OBJS) $(LIBS) -$(BASEDIR)/fmsg_adi.c $(BASEDIR)/imsg_adi.c $(BASEDIR)/nmsg_adi.c: $(TOOLS_DIR)/msgbind$x $(RESFILE) +$(BASEDIR)/fmsg_adi.c $(BASEDIR)/imsg_adi.c $(BASEDIR)/nmsg_adi.c \ +$(BASEDIR)/msg_adi.h: $(TOOLS_DIR)/msgbind$x $(RESFILE) $(TOOLS_DIR)/msgbind $(RESFILE) msg_adi $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR) # @@ -419,18 +444,9 @@ # clean: - -rm -f $(BASEDIR)/* - -rm -f $(TOOLS_DIR)/* - -rm -f $(ARJCRYPT_DIR)/* - -rm -f $(SFXSTUB_DIR)/* - -rm -f $(ARJSFXV_DIR)/* - -rm -f $(ARJSFX_DIR)/* - -rm -f $(ARJSFXJR_DIR)/* - -rm -f $(ARJ_DIR)/* - -rm -f $(REARJ_DIR)/* - -rm -f $(REGISTER_DIR)/* - -rm -f $(ARJDISP_DIR)/* - -rm -f arj.core + rm -rf .deps + rm -rf $(BASEDIR) + rm -f arj.core # # Local installation --- arj-git-6af974651.old/integr.c +++ arj-git-6af974651/integr.c @@ -5,7 +5,7 @@ * */ -static const char intergrity_identifier[] = { +static volatile const char intergrity_identifier[] = { 0xB0, 0x03, 0xB0, 0x02, 0xB0, 0x03, 0xB0, 0x04, 0xB0, 0x05, 0x90, 0x90, 0x90, 0x90, --- arj-git-6af974651.old/postproc.c +++ arj-git-6af974651/postproc.c @@ -6,6 +6,7 @@ * */ +#include #include "arj.h" /* Operations */ @@ -37,8 +38,9 @@ static char buf[PROC_BLOCK_SIZE]; -static void _fput_dword(const unsigned long l, FILE *stream) +static void _fput_dword(const unsigned long w, FILE *stream) { + uint32_t l = (uint32_t)w; #ifdef WORDS_BIGENDIAN fputc(l ,stream); fputc(l>>8 ,stream); --- arj-git-6af974651.old/rearj.c +++ arj-git-6af974651/rearj.c @@ -935,7 +935,7 @@ msg_cprintf(H_HL|H_NFMT, M_OLD_SIZE, old_fsize); msg_cprintf(H_HL|H_NFMT, M_NEW_SIZE, new_fsize); msg_cprintf(H_HL|H_NFMT, M_SAVINGS_SIZE, gain); - printf(lf); + printf("\n"); total_old_fsize+=old_fsize; total_new_fsize+=new_fsize; total_files++; --- arj-git-6af974651.old/register.c +++ arj-git-6af974651/register.c @@ -205,7 +205,7 @@ char reg_source[200]; int i; - printf(M_REGISTER_BANNER); + fputs(M_REGISTER_BANNER, stdout); integrity_pattern[0]--; build_crc32_table(); if(argc!=2) --- arj-git-6af974651.old/resource/en/arj.1 +++ arj-git-6af974651/resource/en/arj.1 @@ -21,6 +21,9 @@ .IR archive [ .arj ] .RI [ "base directory" ] .RI [ "!list name" | "path name" | "wildcard name" ] +.SH DESCRIPTION +\fIarj\fP is a compression and file archiving utility. It was invented by +Robert K. Jung. \fIARJ\fP stands for \fIA\fPrchived by \fIR\fPobert \fIJ\fPung. .SH COMMANDS .TP .B ac --- arj-git-6af974651.old/uxspec.c +++ arj-git-6af974651/uxspec.c @@ -120,6 +120,58 @@ } #endif +#if TARGET==UNIX +static int is_link_traversal(const char *name) +{ + enum { + STATE_NONE, + STATE_DOTS, + STATE_NAME, + } state = STATE_NONE; + int ndir = 0; + int dots = 0; + + while(*name) { + int c = *name++; + + if (c == '/') + { + if ((state == STATE_DOTS) && (dots == 2)) + ndir--; + if (ndir < 0) + return 1; + if ((state == STATE_DOTS && dots == 1) && ndir == 0) + return 1; + if (state == STATE_NONE && ndir == 0) + return 1; + if ((state == STATE_DOTS) && (dots > 2)) + ndir++; + state = STATE_NONE; + dots = 0; + } + else if (c == '.') + { + if (state == STATE_NONE) + state = STATE_DOTS; + dots++; + } + else + { + if (state == STATE_NONE) + ndir++; + state = STATE_NAME; + } + } + + if ((state == STATE_DOTS) && (dots == 2)) + ndir--; + if ((state == STATE_DOTS) && (dots > 2)) + ndir++; + + return ndir < 0; +} +#endif + /* Restores the UNIX special file data */ int set_uxspecial(char FAR *storage, char *name) @@ -156,6 +208,8 @@ l=sizeof(tmp_name)-1; far_memmove((char FAR *)tmp_name, dptr, l); tmp_name[l]='\0'; + if (is_link_traversal(tmp_name)) + return(UXSPEC_RC_ERROR); rc=(id==UXSB_HLNK)?link(tmp_name, name):symlink(tmp_name, name); if(!rc) return(0);