View | Details | Raw Unified | Return to bug 221589 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-2 / +1 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	arj
4
PORTNAME=	arj
5
PORTVERSION=	3.10.22
5
PORTVERSION=	3.10.22
6
PORTREVISION=	4
6
PORTREVISION=	5
7
CATEGORIES=	archivers
7
CATEGORIES=	archivers
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/2.78_3.10%20build%2022
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/2.78_3.10%20build%2022
9
9
Lines 21-27 Link Here
21
MAKE_ARGS=	LOCALE="${LANGUAGE}"
21
MAKE_ARGS=	LOCALE="${LANGUAGE}"
22
ALL_TARGET=	prepare all
22
ALL_TARGET=	prepare all
23
STRIP=		# empty
23
STRIP=		# empty
24
MAKE_JOBS_UNSAFE=	yes
25
24
26
CFLAGS+=	-fPIC
25
CFLAGS+=	-fPIC
27
LANGUAGE?=	en
26
LANGUAGE?=	en
(-)files/patch-arj__arcv.c (+46 lines)
Lines 58-60 Link Here
58
 }
58
 }
59
 
59
 
60
 /* Calculates and stores the basic header size */
60
 /* Calculates and stores the basic header size */
61
@@ -913,13 +913,13 @@ int supply_comment(char *cmtname, char *name)
62
     else
63
     {
64
      strcat(tmp_comment, tmp_cmtline);
65
-     strcat(tmp_comment, lf);
66
+     strcat(tmp_comment, "\n");
67
     }
68
    }
69
    else
70
    {
71
     strcat(tmp_comment, tmp_cmtline);
72
-    strcat(tmp_comment, lf);
73
+    strcat(tmp_comment, "\n");
74
    }
75
   }
76
  }
77
@@ -1846,7 +1846,7 @@ int pack_file(int is_update, int is_replace)
78
    raw_eh=eh_lookup(eh, UXSPECIAL_ID)->raw;
79
    uxspecial_stats(raw_eh, UXSTATS_SHORT);
80
   }
81
-  msg_cprintf(0, lf);
82
+  msg_cprintf(0, "\n");
83
  }
84
  if(err_id==0&&user_wants_fail)
85
  {
86
@@ -2523,9 +2523,9 @@ int unpack_validation()
87
    {
88
     msg_cprintf(0, (FMSG *)strform, misc_buf);
89
     if(search_mode==SEARCH_DEFAULT)
90
-     msg_cprintf(0, (FMSG *)lf);
91
+     msg_cprintf(0, "\n");
92
     if(search_mode==SEARCH_BRIEF)
93
-     msg_cprintf(0, (FMSG *)cr);
94
+     msg_cprintf(0, "\r");
95
    }
96
    for(pattern=0; pattern<SEARCH_STR_MAX; search_occurences[pattern++]=0);
97
    reserve_size=0;
98
@@ -3652,7 +3652,7 @@ void archive_cleanup()
99
  {
100
   if(msg_fprintf(idxstream, M_TESTING, archive_name)<0)
101
    error(M_DISK_FULL);
102
-  if(fprintf(idxstream, lf)<0)
103
+  if(fprintf(idxstream, "\n")<0)
104
    error(M_DISK_FULL);
105
  }
106
  cmd_verb=ARJ_CMD_TEST;
(-)files/patch-arj__proc.c (-4 / +8 lines)
Lines 9-15 Link Here
9
 {
9
 {
10
  unsigned long pvol;
10
  unsigned long pvol;
11
  unsigned int arjsec_overhead;
11
  unsigned int arjsec_overhead;
12
@@ -605,7 +605,7 @@ unsigned long get_volfree(unsigned int i
12
@@ -605,7 +605,7 @@ unsigned long get_volfree(unsigned int increment)
13
  remain=volume_limit-ftell(aostream)-pvol-(long)arjsec_overhead-
13
  remain=volume_limit-ftell(aostream)-pvol-(long)arjsec_overhead-
14
         (long)out_bytes-(long)cpos-(long)ext_voldata-
14
         (long)out_bytes-(long)cpos-(long)ext_voldata-
15
         MULTIVOLUME_RESERVE-t_volume_offset;
15
         MULTIVOLUME_RESERVE-t_volume_offset;
Lines 36-43 Link Here
36
      tsptr++;
36
      tsptr++;
37
    }
37
    }
38
   }
38
   }
39
@@ -2901,9 +2901,9 @@ char *ltrim(char *str)
39
@@ -2898,12 +2898,12 @@ char *ltrim(char *str)
40
 #if defined(WORDS_BIGENDIAN)&&!defined(ARJDISP)&&!defined(REGISTER)
40
 }
41
 #endif
42
 
43
-#if defined(WORDS_BIGENDIAN)&&!defined(ARJDISP)&&!defined(REGISTER)
44
+#if (defined(WORDS_BIGENDIAN) || defined(ALIGN_POINTERS)) && !defined(ARJDISP) && !defined(REGISTER)
41
 /* Model-independent routine to get 2 bytes from far RAM */
45
 /* Model-independent routine to get 2 bytes from far RAM */
42
 
46
 
43
-unsigned int mget_word(char FAR *p)
47
-unsigned int mget_word(char FAR *p)
Lines 69-75 Link Here
69
 {
73
 {
70
  mput_byte(w&0xFF, p);
74
  mput_byte(w&0xFF, p);
71
  mput_byte(w>>8  , p+1);
75
  mput_byte(w>>8  , p+1);
72
@@ -2931,7 +2931,7 @@ void mput_word(unsigned int w, char FAR 
76
@@ -2931,7 +2931,7 @@ void mput_word(unsigned int w, char FAR *p)
73
 
77
 
74
 /* Model-independent routine to store 4 bytes in far RAM */
78
 /* Model-independent routine to store 4 bytes in far RAM */
75
 
79
 
(-)files/patch-arj__proc.h (-5 / +8 lines)
Lines 10-22 Link Here
10
 
10
 
11
-#define mget_byte(p) (*(unsigned char FAR *)(p)&0xFF)
11
-#define mget_byte(p) (*(unsigned char FAR *)(p)&0xFF)
12
-#define mput_byte(c, p) *(unsigned char FAR *)(p)=(unsigned char)(c)
12
-#define mput_byte(c, p) *(unsigned char FAR *)(p)=(unsigned char)(c)
13
+#define mget_byte(p) (*(uint8_t FAR *)(p)&0xFF)
13
-#ifndef WORDS_BIGENDIAN
14
+#define mput_byte(c, p) *(uint8_t FAR *)(p)=(uint8_t)(c)
15
 #ifndef WORDS_BIGENDIAN
16
-#define mget_word(p) (*(unsigned short *)(p)&0xFFFF)
14
-#define mget_word(p) (*(unsigned short *)(p)&0xFFFF)
17
-#define mput_word(w,p) (*(unsigned short *)(p)=(unsigned short)(w))
15
-#define mput_word(w,p) (*(unsigned short *)(p)=(unsigned short)(w))
18
-#define mget_dword(p) (*(unsigned long *)(p))
16
-#define mget_dword(p) (*(unsigned long *)(p))
19
-#define mput_dword(w,p) (*(unsigned long *)(p)=(unsigned long)(w))
17
-#define mput_dword(w,p) (*(unsigned long *)(p)=(unsigned long)(w))
18
+#define mget_byte(p) (*(uint8_t FAR *)(p)&0xFF)
19
+#define mput_byte(c, p) *(uint8_t FAR *)(p)=(uint8_t)(c)
20
+#if !defined(ALIGN_POINTERS) && !defined(WORDS_BIGENDIAN)
20
+#define mget_word(p) (*(uint16_t *)(p)&0xFFFF)
21
+#define mget_word(p) (*(uint16_t *)(p)&0xFFFF)
21
+#define mput_word(w,p) (*(uint16_t *)(p)=(uint16_t)(w))
22
+#define mput_word(w,p) (*(uint16_t *)(p)=(uint16_t)(w))
22
+#define mget_dword(p) (*(uint32_t *)(p))
23
+#define mget_dword(p) (*(uint32_t *)(p))
Lines 33-46 Link Here
33
 unsigned int check_multivolume(unsigned int increment);
34
 unsigned int check_multivolume(unsigned int increment);
34
 void store();
35
 void store();
35
 void hollow_encode();
36
 void hollow_encode();
36
@@ -61,10 +63,10 @@ void unpack_mem(struct mempack *mempack)
37
@@ -60,11 +62,11 @@ void pack_mem(struct mempack *mempack);
38
 void unpack_mem(struct mempack *mempack);
37
 void strip_lf(char *str);
39
 void strip_lf(char *str);
38
 char *ltrim(char *str);
40
 char *ltrim(char *str);
39
 #ifdef WORDS_BIGENDIAN
41
-#ifdef WORDS_BIGENDIAN
40
-unsigned int mget_word(char FAR *p);
42
-unsigned int mget_word(char FAR *p);
41
-unsigned long mget_dword(char FAR *p);
43
-unsigned long mget_dword(char FAR *p);
42
-void mput_word(unsigned int w, char FAR *p);
44
-void mput_word(unsigned int w, char FAR *p);
43
-void mput_dword(unsigned long d, char FAR *p);
45
-void mput_dword(unsigned long d, char FAR *p);
46
+#if defined(ALIGN_POINTERS) || defined(WORDS_BIGENDIAN)
44
+uint16_t mget_word(char FAR *p);
47
+uint16_t mget_word(char FAR *p);
45
+uint32_t mget_dword(char FAR *p);
48
+uint32_t mget_dword(char FAR *p);
46
+void mput_word(uint16_t w, char FAR *p);
49
+void mput_word(uint16_t w, char FAR *p);
(-)files/patch-arj__user.c (+38 lines)
Line 0 Link Here
1
--- arj_user.c.orig	2004-06-18 16:19:36 UTC
2
+++ arj_user.c
3
@@ -1059,7 +1059,7 @@ static void finish_processing(int cmd)
4
      if(recover_file(tmp_archive_name, nullstr, tmp_tmp_filename, protected, eof_pos))
5
      {
6
       msg_cprintf(H_HL, M_CANT_FIND_DAMAGE, archive_name);
7
-      printf(lf);
8
+      printf("\n");
9
      }
10
      else
11
      {
12
@@ -1294,7 +1294,7 @@ static void finish_processing(int cmd)
13
    if(recover_file(archive_name, nullstr, nullstr, protected, eof_pos))
14
    {
15
     msg_cprintf(H_HL, M_CANT_FIND_DAMAGE, archive_name);
16
-    printf(lf);
17
+    printf("\n");
18
    }
19
    else
20
    {
21
@@ -1327,7 +1327,7 @@ static void finish_processing(int cmd)
22
     msg_cprintf(0, M_CHAPTERS_ON);
23
    else if(chapter_mode==CHAP_REMOVE)
24
     msg_cprintf(0, M_CHAPTERS_OFF);
25
-   msg_cprintf(0, strform, lf);
26
+   msg_cprintf(0, strform, "\n");
27
   }
28
   if(cmd==ARJ_CMD_COPY&&protfile_option&&!arjprot_tail)
29
    msg_cprintf(0, M_ARJPROT_DISABLED);
30
@@ -2303,7 +2303,7 @@ void process_archive()
31
   timestamp_to_str(timetext, &ftime_stamp);
32
   msg_cprintf(H_HL|H_NFMT, M_ARCHIVE_CREATED, timetext);
33
   if(show_ansi_comments)
34
-   printf(cmt_ptr);
35
+   fputs(cmt_ptr, stdout);
36
   else
37
    display_comment(cmt_ptr);
38
   /* The sfx_setup() occurs here */
(-)files/patch-arjdisp.c (+133 lines)
Line 0 Link Here
1
--- arjdisp.c.orig	2003-06-22 11:12:28 UTC
2
+++ arjdisp.c
3
@@ -20,8 +20,6 @@ static long bytes;
4
 static long compsize;
5
 static char cmd_verb;
6
 static char msg_lf[]="\n";
7
-char strform[]="%s";                    /* Export it for scrnio.c, too
8
-                                           (a byte saved is a byte gained) */
9
 
10
 /* Pseudographical controls */
11
 
12
@@ -54,19 +52,19 @@ static void show_init_scrn()
13
  textcolor(7);
14
  clrscr();
15
  gotoxy(2, 2);
16
- scrprintf(win_top);
17
+ fputs(win_top, stdout);
18
  for(i=3; i<24; i++)
19
  {
20
-  gotoxy(2, i); scrprintf(win_border);
21
-  gotoxy(79, i); scrprintf(win_border);
22
+  gotoxy(2, i); fputs(win_border, stdout);
23
+  gotoxy(79, i); fputs(win_border, stdout);
24
  }
25
- gotoxy(2, 24); scrprintf(win_bottom);
26
+ gotoxy(2, 24); fputs(win_bottom, stdout);
27
  gotoxy(10, 5);
28
- scrprintf(M_ARJDISP_COPYRIGHT);
29
+ fputs(M_ARJDISP_COPYRIGHT, stdout);
30
  gotoxy(10, 6);
31
- scrprintf(M_ARJDISP_DISTRIBUTION);
32
+ fputs(M_ARJDISP_DISTRIBUTION, stdout);
33
  gotoxy(10, 7);
34
- scrprintf(M_ARJDISP_LICENSE);
35
+ fputs(M_ARJDISP_LICENSE, stdout);
36
  gotoxy(16, 10);
37
  scrprintf(M_PROCESSING_ARCHIVE, archive_name);
38
  t=strtok(M_ARJDISP_INFO, msg_lf);
39
@@ -74,11 +72,11 @@ static void show_init_scrn()
40
  while(t!=NULL&&i<=23)
41
  {
42
   gotoxy(10, i++);
43
-  scrprintf(strform, t);
44
+  scrprintf("%s", t);
45
   t=strtok(NULL, msg_lf);
46
  }
47
  gotoxy(16, 20);
48
- scrprintf(M_PRESS_ANY_KEY);
49
+ fputs(M_PRESS_ANY_KEY, stdout);
50
  uni_getch();
51
  gotoxy(1, 24);
52
 }
53
@@ -96,19 +94,19 @@ static void show_proc_scrn()
54
  {
55
   clrscr();
56
   gotoxy(2, 2);
57
-  scrprintf(win_top);
58
+  fputs(win_top, stdout);
59
   for(i=3; i<24; i++)
60
   {
61
-   gotoxy(2, i); scrprintf(win_border);
62
-   gotoxy(79, i); scrprintf(win_border);
63
+   gotoxy(2, i); fputs(win_border, stdout);
64
+   gotoxy(79, i); fputs(win_border, stdout);
65
   }
66
-  gotoxy(2, 24); scrprintf(win_bottom);
67
+  gotoxy(2, 24); fputs(win_bottom, stdout);
68
   gotoxy(10, 5);
69
-  scrprintf(M_ARJDISP_COPYRIGHT);
70
+  fputs(M_ARJDISP_COPYRIGHT, stdout);
71
   gotoxy(10, 6);
72
-  scrprintf(M_ARJDISP_DISTRIBUTION);
73
+  fputs(M_ARJDISP_DISTRIBUTION, stdout);
74
   gotoxy(10, 7);
75
-  scrprintf(M_ARJDISP_LICENSE);
76
+  fputs(M_ARJDISP_LICENSE, stdout);
77
   gotoxy(16, 10);
78
   scrprintf(M_PROCESSING_ARCHIVE, archive_name);
79
   gotoxy(16, 12);
80
@@ -132,13 +130,13 @@ static void show_proc_scrn()
81
     break;
82
   }
83
   gotoxy(15, 14);
84
-  scrprintf(ind_top);
85
+  fputs(ind_top, stdout);
86
   gotoxy(15, 15);
87
-  scrprintf(ind_middle);
88
+  fputs(ind_middle, stdout);
89
   gotoxy(15, 16);
90
-  scrprintf(ind_bottom);
91
+  fputs(ind_bottom, stdout);
92
   gotoxy(16, 18);
93
-  scrprintf(M_ARJDISP_CTR_START);
94
+  fputs(M_ARJDISP_CTR_START, stdout);
95
  }
96
  else
97
  {
98
@@ -146,7 +144,7 @@ static void show_proc_scrn()
99
   gotoxy(16, 15);
100
   memset(progress, indo, i);
101
   progress[i]='\0';
102
-  scrprintf(progress);
103
+  fputs(progress, stdout);
104
   gotoxy(16, 18);
105
   scrprintf(M_ARJDISP_CTR, calc_percentage(bytes, uncompsize)/10);
106
  }
107
@@ -165,19 +163,19 @@ static void show_ending_scrn()
108
  textcolor(7);
109
  clrscr();
110
  gotoxy(2, 2);
111
- scrprintf(win_top);
112
+ fputs(win_top, stdout);
113
  for(i=3; i<24; i++)
114
  {
115
-  gotoxy(2, i); scrprintf(win_border);
116
-  gotoxy(79, i); scrprintf(win_border);
117
+  gotoxy(2, i); fputs(win_border, stdout);
118
+  gotoxy(79, i); fputs(win_border, stdout);
119
  }
120
- gotoxy(2, 24); scrprintf(win_bottom);
121
+ gotoxy(2, 24); fputs(win_bottom, stdout);
122
  gotoxy(10, 5);
123
- scrprintf(M_ARJDISP_COPYRIGHT);
124
+ fputs(M_ARJDISP_COPYRIGHT, stdout);
125
  gotoxy(10, 6);
126
- scrprintf(M_ARJDISP_DISTRIBUTION);
127
+ fputs(M_ARJDISP_DISTRIBUTION, stdout);
128
  gotoxy(10, 7);
129
- scrprintf(M_ARJDISP_LICENSE);
130
+ fputs(M_ARJDISP_LICENSE, stdout);
131
  gotoxy(16, 10);
132
  scrprintf(M_FINISHED_PROCESSING, archive_name);
133
  gotoxy(1, 24);
(-)files/patch-arjsfx.c (+11 lines)
Line 0 Link Here
1
--- arjsfx.c.orig	2005-06-21 19:53:14 UTC
2
+++ arjsfx.c
3
@@ -214,7 +214,7 @@ static void final_cleanup(void)
4
   freopen(dev_con, m_w, stdout);
5
  #if SFX_LEVEL>=ARJSFXV
6
   if(ferror(stdout))
7
-   msg_fprintf(stderr, M_DISK_FULL);
8
+   msg_fprintf(stderr, "Can't write file. Disk full?");
9
   if(debug_enabled&&strchr(debug_opt, 't')!=NULL)
10
   {
11
    ticks=get_ticks()-ticks;
(-)files/patch-arjtypes.c (+15 lines)
Line 0 Link Here
1
--- arjtypes.c.orig	2017-07-31 18:54:59 UTC
2
+++ arjtypes.c
3
@@ -138,8 +138,11 @@ static int isleapyear(int year)
4
 static unsigned long ts_unix2dos(const long ts)
5
 {
6
  struct tm *stm;
7
+ time_t _ts;
8
 
9
- stm=arj_localtime((time_t*)&ts);
10
+ _ts = ts;
11
+
12
+ stm=arj_localtime(&_ts);
13
  return(get_tstamp(stm->tm_year+1900, stm->tm_mon+1, stm->tm_mday,
14
         stm->tm_hour, stm->tm_min, stm->tm_sec));
15
 }
(-)files/patch-decode.c (+53 lines)
Line 0 Link Here
1
--- decode.c	2017-07-31 09:00:00 UTC
2
+++ decode.c
3
@@ -255,7 +255,7 @@ void read_pt_len(int nn, int nbit, int i
4
    if(i==i_special)
5
    {
6
     c=getbits(2);
7
-    while(--c>=0)
8
+    while(--c>=0&&i<nn)
9
      pt_len[i++]=0;
10
    }
11
   }
12
@@ -314,10 +314,10 @@ void read_c_len()
13
      c=getbits(CBIT);
14
      c+=20;
15
     }
16
-    while(--c>=0)
17
+    while(--c>=0&&i<NC)
18
      c_len[i++]=0;
19
    }
20
-   else
21
+   else if (i<NC)
22
     c_len[i++]=(unsigned char)(c-2);
23
   }
24
   while(i<NC)
25
@@ -416,10 +416,10 @@ static void NEAR decode_end()
26
 
27
 void decode(int action)
28
 {
29
- short i;
30
- short r;
31
- short c;
32
- static short j;
33
+ int i;
34
+ int r;
35
+ int c;
36
+ static int j;
37
 
38
  #if SFX_LEVEL>=ARJSFXV
39
  if(!setjmp(decode_proc))
40
@@ -450,9 +450,12 @@ void decode(int action)
41
    {
42
     j=c-(UCHAR_MAX+1-THRESHOLD);
43
     count-=(unsigned long)j;
44
-    i=r-decode_p()-1;
45
+    int P = decode_p();
46
+    i=r-P-1;
47
     if(i<0)
48
      i+=DICSIZ;
49
+    if(i<0)
50
+      goto termination;
51
     if(r>i&&r<DICSIZ-MAXMATCH-1)
52
     {
53
      while(--j>=0)
(-)files/patch-environ.c (-1 / +18 lines)
Lines 1-6 Link Here
1
--- environ.c.orig	2004-06-18 16:19:36 UTC
1
--- environ.c.orig	2004-06-18 16:19:36 UTC
2
+++ environ.c
2
+++ environ.c
3
@@ -2058,7 +2058,7 @@ FILE *file_open(char *name, char *mode)
3
@@ -1087,6 +1087,8 @@ static char *validate_path(char *name)
4
   if(action!=VALIDATE_DRIVESPEC)
5
   {
6
 #endif
7
+   while (name[0]!='\0'&&
8
+          (name[0]=='.'||name[0]==PATHSEP_DEFAULT||name[0]==PATHSEP_UNIX)) {
9
    if(name[0]=='.')
10
    {
11
     if(name[1]=='.'&&(name[2]==PATHSEP_DEFAULT||name[2]==PATHSEP_UNIX))
12
@@ -1096,6 +1098,7 @@ static char *validate_path(char *name)
13
    }
14
    if(name[0]==PATHSEP_DEFAULT||name[0]==PATHSEP_UNIX)
15
     name++;                             /* "\\" - revert to root */
16
+   }
17
 #if SFX_LEVEL>=ARJSFXV
18
   }
19
  }
20
@@ -2058,7 +2061,7 @@ FILE *file_open(char *name, char *mode)
4
       /* ASR fix 01/10/2003 -- re-fix to handle umask 022 correctly */
21
       /* ASR fix 01/10/2003 -- re-fix to handle umask 022 correctly */
5
       if((handle=open(name, oflag, 0644))==-1)
22
       if((handle=open(name, oflag, 0644))==-1)
6
        return(NULL);
23
        return(NULL);
(-)files/patch-fardata.c (-3 / +41 lines)
Lines 1-6 Link Here
1
--- fardata.c.orig	2004-04-17 11:39:42 UTC
1
--- fardata.c.orig	2004-04-17 11:39:42 UTC
2
+++ fardata.c
2
+++ fardata.c
3
@@ -190,7 +190,7 @@ int msg_sprintf(char *str, FMSG *fmt, ..
3
@@ -52,7 +52,7 @@ int error_proc(FMSG *errmsg, ...)
4
   /* Check if the message could have a standard error code */
5
   if(errno!=0&&is_std_error(errmsg))
6
   {
7
-   msg_cprintf(0, lf);
8
+   msg_cprintf(0, "\n");
9
    error_report();
10
   }
11
  #endif
12
@@ -190,7 +190,7 @@ int msg_sprintf(char *str, FMSG *fmt, ...)
4
 
13
 
5
 /* Length-limited strlen() */
14
 /* Length-limited strlen() */
6
 
15
 
Lines 9-15 Link Here
9
 {
18
 {
10
  const char FAR *sc;
19
  const char FAR *sc;
11
 
20
 
12
@@ -569,7 +569,7 @@ int vcprintf(int ccode, FMSG *fmt, va_li
21
@@ -377,10 +377,10 @@ static void flush_cbuf(int ccode, char *text)
22
     {
23
      #if SFX_LEVEL>=ARJSFXV
24
       fprintf(new_stdout, strform, n_text);
25
-      fprintf(new_stdout, lf);
26
+      fprintf(new_stdout, "\n");
27
      #else
28
       printf(strform, n_text);
29
-      printf(lf);
30
+      printf("\n");
31
      #endif
32
     }
33
     else
34
@@ -391,13 +391,13 @@ static void flush_cbuf(int ccode, char *text)
35
      #ifdef NEED_CRLF
36
       scr_out("\r");
37
      #endif
38
-     scr_out(lf);
39
+     scr_out("\n");
40
     }
41
     if(!no_colors)
42
      textcolor(color_table[ccode&H_COLORMASK].color);
43
    #else
44
     printf(strform, n_text);
45
-    printf(lf);
46
+    printf("\n");
47
    #endif
48
    n_text=t_text+1;
49
    #if SFX_LEVEL>=ARJ
50
@@ -569,7 +569,7 @@ int vcprintf(int ccode, FMSG *fmt, va_list args)
13
     if(!s)
51
     if(!s)
14
      s="(null)";
52
      s="(null)";
15
 #endif
53
 #endif
Lines 18-24 Link Here
18
     if(!(flags&LEFT))
56
     if(!(flags&LEFT))
19
     {
57
     {
20
      while(len<field_width--)
58
      while(len<field_width--)
21
@@ -655,7 +655,7 @@ int vcprintf(int ccode, FMSG *fmt, va_li
59
@@ -655,7 +655,7 @@ int vcprintf(int ccode, FMSG *fmt, va_list args)
22
     num=va_arg(args, unsigned long);
60
     num=va_arg(args, unsigned long);
23
    else if(qualifier=='h')
61
    else if(qualifier=='h')
24
    {
62
    {
(-)files/patch-gnu_makefile.in (+176 lines)
Line 0 Link Here
1
--- gnu/makefile.in.orig	2004-04-17 13:28:06 UTC
2
+++ gnu/makefile.in
3
@@ -159,13 +159,16 @@ $(SFXSTUB_DIR)/%.o: $(SRC_DIR)/%.c
4
 # Main dependency tree
5
 #
6
 
7
-.PHONY: timestamp prepare cleanup package help
8
+.PHONY: timestamp msg-headers depends prepare clean package help
9
 
10
 ifdef COMMERCIAL
11
 MAKE_KEY=$(TOOLS_DIR)/make_key$x
12
 endif
13
 
14
-all:	prepare timestamp
15
+all:	prepare
16
+	$(MAKE) timestamp
17
+	$(MAKE) msg-headers
18
+	$(MAKE) depends
19
 	$(MAKE) do-all
20
 
21
 do-all:	\
22
@@ -175,9 +178,29 @@ do-all:	\
23
 	$(REGISTER_DIR)/$(REGISTER)$x \
24
 	$(ARJDISP_DIR)/arjdisp$x \
25
 	$(TOOLS_DIR)/packager$x \
26
-        $(MAKE_KEY) \
27
-	dispose
28
+	$(MAKE_KEY)
29
 
30
+MSG_ID := \
31
+	msg_crp msg_stb msg_sfv msg_sfx msg_sfj msg_arj msg_rej msg_reg msg_adi
32
+MSG_HEADERS := $(patsubst %,$(BASEDIR)/%.h,$(MSG_ID))
33
+
34
+msg-headers: $(MSG_HEADERS)
35
+
36
+.deps:
37
+	mkdir -p $@
38
+
39
+.deps/%.d: %.c .deps
40
+	$(CC) $(CPPFLAGS) $(COPT) $< -MM > $@
41
+
42
+SOURCES = $(wildcard *.c)
43
+DEPS = $(addprefix .deps/,$(SOURCES:.c=.d))
44
+
45
+ifeq ($(sort $(DEPS)),$(sort $(wildcard .deps/*.d)))
46
+include $(DEPS)
47
+endif
48
+
49
+depends: $(DEPS)
50
+
51
 #
52
 # Update timestamp file
53
 #
54
@@ -186,12 +209,6 @@ timestamp: $(TOOLS_DIR)/today$x
55
 	$(TOOLS_DIR)/today$x $(LOCALE) $(BASEDIR)
56
 
57
 #
58
-# Final cleanup
59
-#
60
-
61
-dispose:
62
-
63
-#
64
 # The tools
65
 #
66
 
67
@@ -255,7 +272,7 @@ $(ARJCRYPT_DIR)/arjcrypt$d: $(ARJCRYPT_OBJS) $(TOOLS_D
68
 	$(CC) $(ALL_CFLAGS) $(DLL_FLAGS) -o $@ $(ARJCRYPT_OBJS) $(ARJCRYPT_DEF) $(LIBS)
69
 	$(TOOLS_DIR)/postproc $@
70
 
71
-$(BASEDIR)/nmsg_crp.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
72
+$(BASEDIR)/nmsg_crp.c $(BASEDIR)/msg_crp.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
73
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_crp $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
74
 
75
 #
76
@@ -269,7 +286,7 @@ $(SFXSTUB_DIR)/sfxstub$x: $(SFXSTUB_OBJS) $(TOOLS_DIR)
77
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(SFXSTUB_OBJS) $(LIBS)
78
 	$(TOOLS_DIR)/postproc$x $@ -sfx
79
 
80
-$(BASEDIR)/nmsg_stb.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
81
+$(BASEDIR)/nmsg_stb.c $(BASEDIR)/msg_stb.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
82
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_stb $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
83
 
84
 #
85
@@ -287,7 +304,8 @@ $(ARJSFXV_DIR)/arjsfxv$x: $(ARJSFXV_OBJS) $(TOOLS_DIR)
86
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXV_OBJS) $(LIBS) $(DYN_LIBS)
87
 	$(TOOLS_DIR)/postproc$x $@ -sfx
88
 
89
-$(BASEDIR)/fmsg_sfv.c $(BASEDIR)/imsg_sfv.c $(BASEDIR)/nmsg_sfv.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
90
+$(BASEDIR)/fmsg_sfv.c $(BASEDIR)/imsg_sfv.c $(BASEDIR)/nmsg_sfv.c \
91
+$(BASEDIR)/msg_sfv.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
92
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_sfv $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
93
 
94
 #
95
@@ -304,7 +322,8 @@ $(ARJSFX_DIR)/arjsfx$x: $(ARJSFX_OBJS) $(TOOLS_DIR)/po
96
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFX_OBJS) $(LIBS)
97
 	$(TOOLS_DIR)/postproc$x $@ -sfx
98
 
99
-$(BASEDIR)/fmsg_sfx.c $(BASEDIR)/imsg_sfx.c $(BASEDIR)/nmsg_sfx.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
100
+$(BASEDIR)/fmsg_sfx.c $(BASEDIR)/imsg_sfx.c $(BASEDIR)/nmsg_sfx.c \
101
+$(BASEDIR)/msg_sfx.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
102
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_sfx $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
103
 
104
 #
105
@@ -319,7 +338,8 @@ $(ARJSFXJR_DIR)/arjsfxjr$x: $(ARJSFXJR_OBJS) $(TOOLS_D
106
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXJR_OBJS) $(LIBS)
107
 	$(TOOLS_DIR)/postproc$x $@ -sfx
108
 
109
-$(BASEDIR)/fmsg_sfj.c $(BASEDIR)/imsg_sfj.c $(BASEDIR)/nmsg_sfj.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
110
+$(BASEDIR)/fmsg_sfj.c $(BASEDIR)/imsg_sfj.c $(BASEDIR)/nmsg_sfj.c \
111
+$(BASEDIR)/msg_sfj.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
112
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_sfj $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
113
 
114
 #
115
@@ -354,7 +374,8 @@ $(ARJ_DIR)/arj$x: $(ARJ_OBJS) \
116
 	$(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(BASEDIR)/help.arj
117
 	$(TOOLS_DIR)/postproc $@
118
 
119
-$(BASEDIR)/fmsg_arj.c $(BASEDIR)/imsg_arj.c $(BASEDIR)/nmsg_arj.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
120
+$(BASEDIR)/fmsg_arj.c $(BASEDIR)/imsg_arj.c $(BASEDIR)/nmsg_arj.c \
121
+$(BASEDIR)/msg_arj.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
122
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_arj $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
123
 
124
 #
125
@@ -372,7 +393,8 @@ $(REARJ_DIR)/rearj$x: $(REARJ_OBJS) \
126
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REARJ_OBJS) $(LIBS)
127
 	$(TOOLS_DIR)/postproc $@
128
 
129
-$(BASEDIR)/fmsg_rej.c $(BASEDIR)/imsg_rej.c $(BASEDIR)/nmsg_rej.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
130
+$(BASEDIR)/fmsg_rej.c $(BASEDIR)/imsg_rej.c $(BASEDIR)/nmsg_rej.c \
131
+$(BASEDIR)/msg_rej.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
132
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_rej $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
133
 
134
 #
135
@@ -388,7 +410,8 @@ $(REGISTER_DIR)/$(REGISTER)$x: $(REGISTER_OBJS) \
136
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REGISTER_OBJS) $(LIBS)
137
 	$(TOOLS_DIR)/postproc $@ -sfx
138
 
139
-$(BASEDIR)/fmsg_reg.c $(BASEDIR)/imsg_reg.c $(BASEDIR)/nmsg_reg.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
140
+$(BASEDIR)/fmsg_reg.c $(BASEDIR)/imsg_reg.c $(BASEDIR)/nmsg_reg.c \
141
+$(BASEDIR)/msg_reg.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
142
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_reg $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
143
 
144
 #
145
@@ -402,7 +425,8 @@ ARJDISP_OBJS = $(patsubst %,$(ARJDISP_DIR)/%, \
146
 $(ARJDISP_DIR)/arjdisp$x: $(ARJDISP_OBJS)
147
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJDISP_OBJS) $(LIBS)
148
 
149
-$(BASEDIR)/fmsg_adi.c $(BASEDIR)/imsg_adi.c $(BASEDIR)/nmsg_adi.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
150
+$(BASEDIR)/fmsg_adi.c $(BASEDIR)/imsg_adi.c $(BASEDIR)/nmsg_adi.c \
151
+$(BASEDIR)/msg_adi.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
152
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_adi $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
153
 
154
 #
155
@@ -427,18 +451,9 @@ prepare:
156
 #
157
 
158
 clean:
159
-	-rm -f $(BASEDIR)/*
160
-	-rm -f $(TOOLS_DIR)/*
161
-	-rm -f $(ARJCRYPT_DIR)/*
162
-	-rm -f $(SFXSTUB_DIR)/*
163
-	-rm -f $(ARJSFXV_DIR)/*
164
-	-rm -f $(ARJSFX_DIR)/*
165
-	-rm -f $(ARJSFXJR_DIR)/*
166
-	-rm -f $(ARJ_DIR)/*
167
-	-rm -f $(REARJ_DIR)/*
168
-	-rm -f $(REGISTER_DIR)/*
169
-	-rm -f $(ARJDISP_DIR)/*
170
-	-rm -f arj.core
171
+	rm -rf .deps
172
+	rm -rf $(BASEDIR)
173
+	rm -f arj.core
174
 
175
 #
176
 # Local installation
(-)files/patch-rearj.c (+11 lines)
Line 0 Link Here
1
--- rearj.c.orig	2017-08-16 08:08:49 UTC
2
+++ rearj.c
3
@@ -935,7 +935,7 @@ static int convert_archive(char *name)
4
  msg_cprintf(H_HL|H_NFMT, M_OLD_SIZE, old_fsize);
5
  msg_cprintf(H_HL|H_NFMT, M_NEW_SIZE, new_fsize);
6
  msg_cprintf(H_HL|H_NFMT, M_SAVINGS_SIZE, gain);
7
- printf(lf);
8
+ printf("\n");
9
  total_old_fsize+=old_fsize;
10
  total_new_fsize+=new_fsize;
11
  total_files++;
(-)files/patch-register.c (+11 lines)
Line 0 Link Here
1
--- register.c.orig	2004-04-21 07:04:10 UTC
2
+++ register.c
3
@@ -205,7 +205,7 @@ int main(int argc, char **argv)
4
  char reg_source[200];
5
  int i;
6
 
7
- printf(M_REGISTER_BANNER);
8
+ fputs(M_REGISTER_BANNER, stdout);
9
  integrity_pattern[0]--;
10
  build_crc32_table();
11
  if(argc!=2)
(-)files/patch-uxspec.c (+70 lines)
Line 0 Link Here
1
--- uxspec.c.orig	2004-04-17 13:39:42 UTC
2
+++ uxspec.c
3
@@ -120,6 +120,58 @@ int query_uxspecial(char FAR **dest, char *name, struc
4
 }
5
 #endif
6
 
7
+#if TARGET==UNIX
8
+static int is_link_traversal(const char *name)
9
+{
10
+  enum {
11
+    STATE_NONE,
12
+    STATE_DOTS,
13
+    STATE_NAME,
14
+  } state = STATE_NONE;
15
+  int ndir = 0;
16
+  int dots = 0;
17
+
18
+  while(*name) {
19
+    int c = *name++;
20
+
21
+    if (c == '/')
22
+    {
23
+      if ((state == STATE_DOTS) && (dots == 2))
24
+        ndir--;
25
+      if (ndir < 0)
26
+        return 1;
27
+      if ((state == STATE_DOTS && dots == 1) && ndir == 0)
28
+        return 1;
29
+      if (state == STATE_NONE && ndir == 0)
30
+        return 1;
31
+      if ((state == STATE_DOTS) && (dots > 2))
32
+        ndir++;
33
+      state = STATE_NONE;
34
+      dots = 0;
35
+    }
36
+    else if (c == '.')
37
+    {
38
+      if (state == STATE_NONE)
39
+        state = STATE_DOTS;
40
+      dots++;
41
+    }
42
+    else
43
+    {
44
+      if (state == STATE_NONE)
45
+        ndir++;
46
+      state = STATE_NAME;
47
+    }
48
+  }
49
+
50
+  if ((state == STATE_DOTS) && (dots == 2))
51
+    ndir--;
52
+  if ((state == STATE_DOTS) && (dots > 2))
53
+    ndir++;
54
+
55
+  return ndir < 0;
56
+}
57
+#endif
58
+
59
 /* Restores the UNIX special file data */
60
 
61
 int set_uxspecial(char FAR *storage, char *name)
62
@@ -156,6 +208,8 @@ int set_uxspecial(char FAR *storage, char *name)
63
      l=sizeof(tmp_name)-1;
64
     far_memmove((char FAR *)tmp_name, dptr, l);
65
     tmp_name[l]='\0';
66
+    if (is_link_traversal(tmp_name))
67
+      return(UXSPEC_RC_ERROR);
68
     rc=(id==UXSB_HLNK)?link(tmp_name, name):symlink(tmp_name, name);
69
     if(!rc)
70
      return(0);

Return to bug 221589