*
* Based in part on the tar implementation from busybox-0.28
* Copyright (C) 1995 Bruce Perens
- * This is free software under the GNU General Public License.
*
- * Licensed under GPL v2 (or later), see file LICENSE in this tarball.
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <fcntl.h>
/* Tar file constants */
# define TAR_MAGIC "ustar" /* ustar and a null */
-# define TAR_VERSION " " /* Be compatable with GNU tar format */
+# define TAR_VERSION " " /* Be compatible with GNU tar format */
#define TAR_BLOCK_SIZE 512
#define TAR_MAGIC_LEN 6
#define TAR_OPT_AFTER_START 8
#define CTX_CREATE (1 << (TAR_OPT_AFTER_START))
-#define TAR_OPT_DEREFERNCE (1 << (TAR_OPT_AFTER_START + 1))
+#define TAR_OPT_DEREFERENCE (1 << (TAR_OPT_AFTER_START + 1))
#ifdef CONFIG_FEATURE_TAR_CREATE
# define TAR_OPT_STR_CREATE "ch"
# define TAR_OPT_AFTER_CREATE TAR_OPT_AFTER_START + 2
}
}
- if ((base_dir) && (chdir(base_dir)))
- bb_perror_msg_and_die("Couldnt chdir to %s", base_dir);
+ if (base_dir)
+ bb_xchdir(base_dir);
/* create an archive */
if (ENABLE_FEATURE_TAR_CREATE && (opt & CTX_CREATE)) {
{
verboseFlag = TRUE;
}
- writeTarFile(tar_handle->src_fd, verboseFlag, opt & TAR_OPT_DEREFERNCE, tar_handle->accept,
+ writeTarFile(tar_handle->src_fd, verboseFlag, opt & TAR_OPT_DEREFERENCE,
+ tar_handle->accept,
tar_handle->reject, zipMode);
} else {
while (get_header_ptr(tar_handle) == EXIT_SUCCESS);