head	1.2;
access;
symbols
	RELEASE_8_3_0:1.2
	RELEASE_9_0_0:1.2
	RELEASE_7_4_0:1.2
	RELEASE_8_2_0:1.2
	RELEASE_6_EOL:1.2
	RELEASE_8_1_0:1.2
	RELEASE_7_3_0:1.2
	RELEASE_8_0_0:1.2
	RELEASE_7_2_0:1.2
	RELEASE_7_1_0:1.2
	RELEASE_6_4_0:1.2
	RELEASE_5_EOL:1.2
	RELEASE_7_0_0:1.2
	RELEASE_6_3_0:1.2
	PRE_XORG_7:1.2
	RELEASE_4_EOL:1.2
	RELEASE_6_2_0:1.2
	RELEASE_6_1_0:1.2
	RELEASE_5_5_0:1.2
	RELEASE_6_0_0:1.2
	RELEASE_5_4_0:1.2
	RELEASE_4_11_0:1.2
	RELEASE_5_3_0:1.1
	RELEASE_4_10_0:1.1
	RELEASE_5_2_1:1.1
	RELEASE_5_2_0:1.1
	RELEASE_4_9_0:1.1
	RELEASE_5_1_0:1.1
	RELEASE_4_8_0:1.1
	RELEASE_5_0_0:1.1
	RELEASE_4_7_0:1.1
	RELEASE_4_6_2:1.1
	RELEASE_4_6_1:1.1
	RELEASE_4_6_0:1.1
	RELEASE_5_0_DP1:1.1
	RELEASE_4_5_0:1.1
	RELEASE_4_4_0:1.1
	RELEASE_4_3_0:1.1;
locks; strict;
comment	@# @;


1.2
date	2004.11.29.15.03.09;	author ache;	state Exp;
branches;
next	1.1;

1.1
date	2001.02.01.16.14.47;	author ache;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Upgrade to 2.65
@
text
@--- unarj.c.orig	Wed Jun  5 12:28:06 2002
+++ unarj.c	Mon Nov 29 17:48:27 2004
@@@@ -54,6 +54,10 @@@@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <unistd.h>
 #else /* !MODERN */
 extern void free();
 extern void exit();
@@@@ -718,6 +722,8 @@@@
 extract()
 {
     char name[FNAME_MAX];
+    char dir[FNAME_MAX];
+    char *pos;
 
     if (check_flags())
     {
@@@@ -736,6 +742,21 @@@@
 
     if (host_os != OS)
         default_case_path(name);
+
+
+    /*
+       8/8/2000 Phil Knirsch: Bugfix to create subdirectories. Unarj didn't
+       do this for a long time, so it's finally fixed.
+    */
+    pos = strchr(name, PATH_CHAR);
+
+    while (pos != NULL)
+    {
+        strncpy(dir, name, pos-name);
+        dir[pos-name] = '\0';
+        mkdir(dir, 0777);
+        pos = strchr(pos+1, PATH_CHAR);
+    }
 
     if (file_exists(name))
     {
@


1.1
log
@Create intermediate directories

PR:		24766
Submitted by:	Roman Shterenzon <roman@@xpert.com>
@
text
@d1 3
a3 14
diff -urN unarj-2.43/unarj.c unarj-2.43.new/unarj.c
--- unarj.c.orig	Mon Sep 29 14:00:24 1997
+++ unarj.c	Tue Aug  8 15:57:58 2000
@@@@ -42,7 +42,8 @@@@
  * 02/17/93  R. Jung     Added archive modified date support.
  * 01/22/94  R. Jung     Changed copyright message.
  * 07/29/96  R. Jung     Added "/" to list of path separators.
- *
+ * 08/08/00  P. Knirsch  Added subdirectory creation for the x command. Also
+ *                       fixed some compiler warnings.
  */
 
 #include "unarj.h"
@@@@ -51,6 +52,10 @@@@
d14 1
a14 1
@@@@ -712,6 +717,8 @@@@
d23 1
a23 1
@@@@ -730,6 +737,21 @@@@
@

