From: Sergey Poznyakoff Date: Mon, 26 Apr 2004 09:19:07 +0000 (+0000) Subject: Produce an error, not warning, if the filename is too long. X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=af244aeef3f45e0b431fd6fe8a7d2673ceefb254;p=chaz%2Ftar Produce an error, not warning, if the filename is too long. --- diff --git a/src/create.c b/src/create.c index 689fd27..27c914a 100644 --- a/src/create.c +++ b/src/create.c @@ -459,18 +459,18 @@ write_ustar_long_name (const char *name) if (length > PREFIX_FIELD_SIZE + NAME_FIELD_SIZE + 1) { - WARN ((0, 0, _("%s: file name is too long (max %d); not dumped"), - quotearg_colon (name), - PREFIX_FIELD_SIZE + NAME_FIELD_SIZE + 1)); + ERROR ((0, 0, _("%s: file name is too long (max %d); not dumped"), + quotearg_colon (name), + PREFIX_FIELD_SIZE + NAME_FIELD_SIZE + 1)); return NULL; } i = split_long_name (name, length); if (i == 0 || length - i - 1 > NAME_FIELD_SIZE) { - WARN ((0, 0, - _("%s: file name is too long (cannot be split); not dumped"), - quotearg_colon (name))); + ERROR ((0, 0, + _("%s: file name is too long (cannot be split); not dumped"), + quotearg_colon (name))); return NULL; } @@ -495,10 +495,10 @@ write_long_link (struct tar_stat_info *st) case V7_FORMAT: /* old V7 tar format */ case USTAR_FORMAT: case STAR_FORMAT: - WARN ((0, 0, - _("%s: link name is too long; not dumped"), - quotearg_colon (st->link_name))); - break; + ERROR ((0, 0, + _("%s: link name is too long; not dumped"), + quotearg_colon (st->link_name))); + break; case OLDGNU_FORMAT: case GNU_FORMAT: @@ -522,9 +522,9 @@ write_long_name (struct tar_stat_info *st) case V7_FORMAT: if (strlen (st->file_name) > NAME_FIELD_SIZE-1) { - WARN ((0, 0, _("%s: file name is too long (max %d); not dumped"), - quotearg_colon (st->file_name), - NAME_FIELD_SIZE - 1)); + ERROR ((0, 0, _("%s: file name is too long (max %d); not dumped"), + quotearg_colon (st->file_name), + NAME_FIELD_SIZE - 1)); return NULL; } break;