From af244aeef3f45e0b431fd6fe8a7d2673ceefb254 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Mon, 26 Apr 2004 09:19:07 +0000 Subject: [PATCH] Produce an error, not warning, if the filename is too long. --- src/create.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) 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; -- 2.45.2