588 |
union block *header; |
union block *header; |
589 |
|
|
590 |
name = safer_name_suffix (name, 0); |
name = safer_name_suffix (name, 0); |
|
if (name[0] == '.' && name[1] == 0) /*FIXME!!!*/ |
|
|
return NULL; |
|
591 |
assign_string (&st->file_name, name); |
assign_string (&st->file_name, name); |
592 |
|
|
593 |
header = write_header_name (st); |
header = write_header_name (st); |
1085 |
return ((link1->dev ^ link2->dev) | (link1->ino ^ link2->ino)) == 0; |
return ((link1->dev ^ link2->dev) | (link1->ino ^ link2->ino)) == 0; |
1086 |
} |
} |
1087 |
|
|
1088 |
|
/* Copy at most LEN bytes from SRC to DST. Terminate with NUL unless |
1089 |
|
SRC is LEN characters long */ |
1090 |
|
static void |
1091 |
|
tar_copy_str (char *dst, const char *src, size_t len) |
1092 |
|
{ |
1093 |
|
dst[len-1] = 0; |
1094 |
|
strncpy (dst, src, len); |
1095 |
|
} |
1096 |
|
|
1097 |
/* Table of all non-directories that we've written so far. Any time |
/* Table of all non-directories that we've written so far. Any time |
1098 |
we see another, we check the table and avoid dumping the data |
we see another, we check the table and avoid dumping the data |
1099 |
again if we've done it once already. */ |
again if we've done it once already. */ |
1365 |
|
|
1366 |
block_ordinal = current_block_ordinal (); |
block_ordinal = current_block_ordinal (); |
1367 |
assign_string (¤t_stat_info.link_name, link_name); |
assign_string (¤t_stat_info.link_name, link_name); |
1368 |
if (NAME_FIELD_SIZE <= strlen (link_name)) |
if (NAME_FIELD_SIZE < strlen (link_name)) |
1369 |
write_long_link (¤t_stat_info); |
write_long_link (¤t_stat_info); |
1370 |
|
|
1371 |
current_stat_info.stat.st_size = 0; |
current_stat_info.stat.st_size = 0; |
1372 |
header = start_header (p, ¤t_stat_info); |
header = start_header (p, ¤t_stat_info); |
1373 |
if (!header) |
if (!header) |
1374 |
return; |
return; |
1375 |
strncpy (header->header.linkname, link_name, NAME_FIELD_SIZE); |
tar_copy_str (header->header.linkname, link_name, |
1376 |
|
NAME_FIELD_SIZE); |
|
/* Force null termination. */ |
|
|
header->header.linkname[NAME_FIELD_SIZE - 1] = 0; |
|
1377 |
|
|
1378 |
header->header.typeflag = LNKTYPE; |
header->header.typeflag = LNKTYPE; |
1379 |
finish_header (header, block_ordinal); |
finish_header (header, block_ordinal); |
1704 |
} |
} |
1705 |
buffer[size] = '\0'; |
buffer[size] = '\0'; |
1706 |
assign_string (¤t_stat_info.link_name, buffer); |
assign_string (¤t_stat_info.link_name, buffer); |
1707 |
if (size >= NAME_FIELD_SIZE) |
if (size > NAME_FIELD_SIZE) |
1708 |
write_long_link (¤t_stat_info); |
write_long_link (¤t_stat_info); |
1709 |
|
|
1710 |
block_ordinal = current_block_ordinal (); |
block_ordinal = current_block_ordinal (); |
1712 |
header = start_header (p, ¤t_stat_info); |
header = start_header (p, ¤t_stat_info); |
1713 |
if (!header) |
if (!header) |
1714 |
return; |
return; |
1715 |
strncpy (header->header.linkname, buffer, NAME_FIELD_SIZE); |
tar_copy_str (header->header.linkname, buffer, NAME_FIELD_SIZE); |
|
header->header.linkname[NAME_FIELD_SIZE - 1] = '\0'; |
|
1716 |
header->header.typeflag = SYMTYPE; |
header->header.typeflag = SYMTYPE; |
1717 |
finish_header (header, block_ordinal); |
finish_header (header, block_ordinal); |
1718 |
/* nothing more to do to it */ |
/* nothing more to do to it */ |