File: patch241a

package info (click to toggle)
unarj 2.43-3woody1
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 228 kB
  • ctags: 358
  • sloc: ansic: 2,306; makefile: 110; sh: 8
file content (177 lines) | stat: -rw-r--r-- 4,732 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
diff -r -c ../unarj241/environ.c ./environ.c
*** ../unarj241/environ.c	Wed Jun 23 07:07:20 1993
--- ./environ.c	Sun Apr 10 10:55:06 1994
***************
*** 495,501 ****
--- 495,503 ----
  case_path(name)
  char *name;
  {
+ #ifndef UNIX
      (char *) name;
+ #endif
  }
  
  void
***************
*** 590,595 ****
--- 592,599 ----
      return longtime;
  }
  
+ extern int utime();
+ 
  int
  set_ftime_mode(name, tstamp, attribute, host)
  char  *name;
***************
*** 604,612 ****
--- 608,618 ----
         time_t mtime;             /* New modification time */
      } tb;
  
+ #ifndef UNIX
      (char *) name;
      (uint) attribute;
      (uint) host;
+ #endif
  
      m_time = mstonix(tstamp) + gettz();
  
diff -r -c ../unarj241/unarj.c ./unarj.c
*** ../unarj241/unarj.c	Wed Jun 23 07:07:20 1993
--- ./unarj.c	Sun Apr 10 11:00:56 1994
***************
*** 40,45 ****
--- 40,46 ----
   * 11/24/91  R. Jung     Added more error_count processing.
   * 12/03/91  R. Jung     Added backup file processing.
   * 02/17/93  R. Jung     Added archive modified date support.
+  * 940410    aeb@cwi.nl  Added automatic directory creation for x mode.
   *
   */
  
***************
*** 118,124 ****
  NULL
  };
  
! char M_VERSION [] = "UNARJ (Demo version) 2.41 Copyright (c) 1991-93 Robert K Jung\n\n";
  
  char M_ARCDATE [] = "Archive created: %s";
  char M_ARCDATEM[] = ", modified: %s";
--- 119,125 ----
  NULL
  };
  
! char M_VERSION [] = "UNARJ (Demo version) 2.41a Copyright (c) 1991-93 Robert K Jung\n\n";
  
  char M_ARCDATE [] = "Archive created: %s";
  char M_ARCDATEM[] = ", modified: %s";
***************
*** 707,712 ****
--- 708,734 ----
      return 0;
  }
  
+ #ifdef UNIX
+ extern int mkdir();
+ #define DIRMODE 0755
+ 
+ static void
+ create_required_dirs(name)
+      char *name;
+ {
+     char dirname[FNAME_MAX];
+     char *cp;
+ 
+     strcpy(dirname, name);
+     cp = dirname;
+     while ((cp = strchr(cp, PATH_CHAR))) {
+ 	*cp = 0;
+ 	(void) mkdir(dirname, DIRMODE); /* this will fail if dir existed */
+ 	*cp++ = PATH_CHAR;
+     }
+ }
+ #endif
+ 
  static int
  extract()
  {
***************
*** 738,743 ****
--- 760,769 ----
          error_count++;
          return 0;
      }
+ #ifdef UNIX
+     if (command == 'X')
+         create_required_dirs(name);
+ #endif
      outfile = file_open(name, writemode[file_type & 1]);
      if (outfile == NULL)
      {
diff -r -c ../unarj241/unarj.doc ./unarj.doc
*** ../unarj241/unarj.doc	Wed Jun 23 07:07:21 1993
--- ./unarj.doc	Sun Apr 10 11:18:12 1994
***************
*** 1,11 ****
  
!      UNARJ.DOC, UNARJ 2.41                                   April 1993
  
  
          UNARJ software and manual copyright (c) 1991-93 by Robert K Jung.
  	All rights reserved.
  
!         UNARJ version 2.41 release
  
  
       This documents new or updated information since UNARJ 2.10.
--- 1,11 ----
  
!      UNARJ.DOC, UNARJ 2.41a                                  April 1993
  
  
          UNARJ software and manual copyright (c) 1991-93 by Robert K Jung.
  	All rights reserved.
  
!         UNARJ version 2.41a release
  
  
       This documents new or updated information since UNARJ 2.10.
***************
*** 51,57 ****
  
       UNARJ has been modified to support the four commands: "e", "l", "t",
       and "x".  These are similar to the ARJ version of these commands.
!      However, UNARJ does not create directories when using the "x" command.
  
       Usage:  UNARJ archive[.arj]    (list archive)
  	     UNARJ e archive	    (extract archive)
--- 51,57 ----
  
       UNARJ has been modified to support the four commands: "e", "l", "t",
       and "x".  These are similar to the ARJ version of these commands.
!      Moreover, UNARJ.241a does create directories when using the "x" command.
  
       Usage:  UNARJ archive[.arj]    (list archive)
  	     UNARJ e archive	    (extract archive)
***************
*** 103,110 ****
       This command extracts the contents of the ARJ archive to the pathnames
       stored in the archive.  If only filespecs are stored in the archive,
       then the files will be extracted to the current directory.  UNARJ will
!      not create missing directories in the pathnames.  You must create them
!      manually.	Use the UNARJ t command to see the full pathnames stored in
       the archive.
  
  
--- 103,110 ----
       This command extracts the contents of the ARJ archive to the pathnames
       stored in the archive.  If only filespecs are stored in the archive,
       then the files will be extracted to the current directory.  UNARJ will
!      create missing directories in the pathnames (aeb, 940410).
!      Use the UNARJ t command to see the full pathnames stored in
       the archive.