Print this page
5218 posix definition of NULL
correct unistd.h and iso/stddef_iso.h
update gate source affected
*** 2644,2654 ****
*/
static int
convtoreg(off_t size)
{
if ((size > 0) && (dblock.dbuf.typeflag != '0') &&
! (dblock.dbuf.typeflag != NULL) && (dblock.dbuf.typeflag != '1') &&
(dblock.dbuf.typeflag != '2') && (dblock.dbuf.typeflag != '3') &&
(dblock.dbuf.typeflag != '4') && (dblock.dbuf.typeflag != '5') &&
(dblock.dbuf.typeflag != '6') && (dblock.dbuf.typeflag != 'A') &&
(dblock.dbuf.typeflag != 'L') &&
(dblock.dbuf.typeflag != _XATTR_HDRTYPE) &&
--- 2644,2654 ----
*/
static int
convtoreg(off_t size)
{
if ((size > 0) && (dblock.dbuf.typeflag != '0') &&
! (dblock.dbuf.typeflag != '\0') && (dblock.dbuf.typeflag != '1') &&
(dblock.dbuf.typeflag != '2') && (dblock.dbuf.typeflag != '3') &&
(dblock.dbuf.typeflag != '4') && (dblock.dbuf.typeflag != '5') &&
(dblock.dbuf.typeflag != '6') && (dblock.dbuf.typeflag != 'A') &&
(dblock.dbuf.typeflag != 'L') &&
(dblock.dbuf.typeflag != _XATTR_HDRTYPE) &&
*** 3157,3167 ****
if (rmdir(namep) < 0) {
if (errno == ENOTDIR)
(void) unlink(namep);
}
linkp = templink;
! if (*linkp != NULL) {
if (Aflag && *linkp == '/')
linkp++;
if (link(linkp, namep) < 0) {
(void) fprintf(stderr, gettext(
"tar: %s: cannot link\n"), namep);
--- 3157,3167 ----
if (rmdir(namep) < 0) {
if (errno == ENOTDIR)
(void) unlink(namep);
}
linkp = templink;
! if (*linkp != '\0') {
if (Aflag && *linkp == '/')
linkp++;
if (link(linkp, namep) < 0) {
(void) fprintf(stderr, gettext(
"tar: %s: cannot link\n"), namep);
*** 3198,3208 ****
if (rmdir(namep) < 0) {
if (errno == ENOTDIR)
(void) unlink(namep);
}
linkp = templink;
! if (*linkp != NULL) {
if (Aflag && *linkp == '/')
linkp++;
if (link(linkp, namep) < 0) {
(void) fprintf(stderr, gettext(
"tar: %s: cannot link\n"), namep);
--- 3198,3208 ----
if (rmdir(namep) < 0) {
if (errno == ENOTDIR)
(void) unlink(namep);
}
linkp = templink;
! if (*linkp != '\0') {
if (Aflag && *linkp == '/')
linkp++;
if (link(linkp, namep) < 0) {
(void) fprintf(stderr, gettext(
"tar: %s: cannot link\n"), namep);
*** 3247,3257 ****
if (rmdir(namep) < 0) {
if (errno == ENOTDIR)
(void) unlink(namep);
}
linkp = templink;
! if (*linkp != NULL) {
if (Aflag && *linkp == '/')
linkp++;
if (link(linkp, namep) < 0) {
(void) fprintf(stderr, gettext(
"tar: %s: cannot link\n"), namep);
--- 3247,3257 ----
if (rmdir(namep) < 0) {
if (errno == ENOTDIR)
(void) unlink(namep);
}
linkp = templink;
! if (*linkp != '\0') {
if (Aflag && *linkp == '/')
linkp++;
if (link(linkp, namep) < 0) {
(void) fprintf(stderr, gettext(
"tar: %s: cannot link\n"), namep);
*** 3387,3400 ****
dblock.dbuf.typeflag);
Errflg = 1;
}
}
if (dblock.dbuf.typeflag == '0' ||
! dblock.dbuf.typeflag == NULL || convflag) {
delete_target(dirfd, comp, namep);
linkp = templink;
! if (*linkp != NULL) {
if (Aflag && *linkp == '/')
linkp++;
if (link(linkp, comp) < 0) {
(void) fprintf(stderr, gettext(
"tar: %s: cannot link\n"), namep);
--- 3387,3400 ----
dblock.dbuf.typeflag);
Errflg = 1;
}
}
if (dblock.dbuf.typeflag == '0' ||
! dblock.dbuf.typeflag == '\0' || convflag) {
delete_target(dirfd, comp, namep);
linkp = templink;
! if (*linkp != '\0') {
if (Aflag && *linkp == '/')
linkp++;
if (link(linkp, comp) < 0) {
(void) fprintf(stderr, gettext(
"tar: %s: cannot link\n"), namep);
*** 3596,3606 ****
/* set file ownership */
resugname(dirfd, comp, symflag);
if (pflag && newfile == TRUE && !dir &&
(dblock.dbuf.typeflag == '0' ||
! dblock.dbuf.typeflag == NULL ||
convflag || dblock.dbuf.typeflag == '1')) {
if (fstat(ofile, &xtractbuf) == -1)
(void) fprintf(stderr, gettext(
"tar: cannot stat extracted file "
"%s%s%s%s\n"),
--- 3596,3606 ----
/* set file ownership */
resugname(dirfd, comp, symflag);
if (pflag && newfile == TRUE && !dir &&
(dblock.dbuf.typeflag == '0' ||
! dblock.dbuf.typeflag == '\0' ||
convflag || dblock.dbuf.typeflag == '1')) {
if (fstat(ofile, &xtractbuf) == -1)
(void) fprintf(stderr, gettext(
"tar: cannot stat extracted file "
"%s%s%s%s\n"),
*** 5483,5493 ****
unsigned int h;
file_list_t *exp;
(void) strcpy(name, str);
while (name[strlen(name) - 1] == '/') {
! name[strlen(name) - 1] = NULL;
}
h = hash(name);
if ((exp = (file_list_t *)calloc(sizeof (file_list_t),
sizeof (char))) == NULL) {
--- 5483,5493 ----
unsigned int h;
file_list_t *exp;
(void) strcpy(name, str);
while (name[strlen(name) - 1] == '/') {
! name[strlen(name) - 1] = '\0';
}
h = hash(name);
if ((exp = (file_list_t *)calloc(sizeof (file_list_t),
sizeof (char))) == NULL) {
*** 5521,5531 ****
file_list_t *exp;
char *ptr;
(void) strcpy(name, str);
while (name[strlen(name) - 1] == '/') {
! name[strlen(name) - 1] = NULL;
}
/*
* check for the file name in the passed list
*/
--- 5521,5531 ----
file_list_t *exp;
char *ptr;
(void) strcpy(name, str);
while (name[strlen(name) - 1] == '/') {
! name[strlen(name) - 1] = '\0';
}
/*
* check for the file name in the passed list
*/
*** 5540,5550 ****
/*
* check for any parent directories in the file list
*/
while ((ptr = strrchr(name, '/'))) {
! *ptr = NULL;
h = hash(name);
exp = table[h];
while (exp != NULL) {
if (strcmp(name, exp->name) == 0) {
return (1);
--- 5540,5550 ----
/*
* check for any parent directories in the file list
*/
while ((ptr = strrchr(name, '/'))) {
! *ptr = '\0';
h = hash(name);
exp = table[h];
while (exp != NULL) {
if (strcmp(name, exp->name) == 0) {
return (1);
*** 6613,6623 ****
if (!lstat(namep, &xtractbuf)) {
if ((xtractbuf.st_mode & S_IFMT) != S_IFLNK) {
(void) unlinkat(fd, comp, 0);
} else if ((n = readlink(namep, buf,
PATH_MAX)) != -1) {
! buf[n] = (char)NULL;
(void) unlinkat(fd, buf,
AT_REMOVEDIR);
if (errno == ENOTDIR)
(void) unlinkat(fd, buf, 0);
} else {
--- 6613,6623 ----
if (!lstat(namep, &xtractbuf)) {
if ((xtractbuf.st_mode & S_IFMT) != S_IFLNK) {
(void) unlinkat(fd, comp, 0);
} else if ((n = readlink(namep, buf,
PATH_MAX)) != -1) {
! buf[n] = '\0';
(void) unlinkat(fd, buf,
AT_REMOVEDIR);
if (errno == ENOTDIR)
(void) unlinkat(fd, buf, 0);
} else {