diff options
Diffstat (limited to 'tar.c')
-rw-r--r-- | tar.c | 31 |
1 files changed, 0 insertions, 31 deletions
@@ -103,7 +103,6 @@ static ino_t tarInode; | |||
103 | */ | 103 | */ |
104 | static void readTarFile (int fileCount, char **fileTable); | 104 | static void readTarFile (int fileCount, char **fileTable); |
105 | static void readData (const char *cp, int count); | 105 | static void readData (const char *cp, int count); |
106 | static void createPath (const char *name, int mode); | ||
107 | static long getOctal (const char *cp, int len); | 106 | static long getOctal (const char *cp, int len); |
108 | 107 | ||
109 | static void readHeader (const TarHeader * hp, | 108 | static void readHeader (const TarHeader * hp, |
@@ -1023,36 +1022,6 @@ static void writeTarBlock (const char *buf, int len) | |||
1023 | 1022 | ||
1024 | 1023 | ||
1025 | /* | 1024 | /* |
1026 | * Attempt to create the directories along the specified path, except for | ||
1027 | * the final component. The mode is given for the final directory only, | ||
1028 | * while all previous ones get default protections. Errors are not reported | ||
1029 | * here, as failures to restore files can be reported later. | ||
1030 | */ | ||
1031 | static void createPath (const char *name, int mode) | ||
1032 | { | ||
1033 | char *cp; | ||
1034 | char *cpOld; | ||
1035 | char buf[TAR_NAME_SIZE]; | ||
1036 | |||
1037 | strcpy (buf, name); | ||
1038 | |||
1039 | cp = strchr (buf, '/'); | ||
1040 | |||
1041 | while (cp) { | ||
1042 | cpOld = cp; | ||
1043 | cp = strchr (cp + 1, '/'); | ||
1044 | |||
1045 | *cpOld = '\0'; | ||
1046 | |||
1047 | if (mkdir (buf, cp ? 0777 : mode) == 0) | ||
1048 | printf ("Directory \"%s\" created\n", buf); | ||
1049 | |||
1050 | *cpOld = '/'; | ||
1051 | } | ||
1052 | } | ||
1053 | |||
1054 | |||
1055 | /* | ||
1056 | * Read an octal value in a field of the specified width, with optional | 1025 | * Read an octal value in a field of the specified width, with optional |
1057 | * spaces on both sides of the number and with an optional null character | 1026 | * spaces on both sides of the number and with an optional null character |
1058 | * at the end. Returns -1 on an illegal format. | 1027 | * at the end. Returns -1 on an illegal format. |