1616 *
1717 *
1818 * IDENTIFICATION
19- *$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.67 2010/01/07 04:53:35 tgl Exp $
19+ *$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.68 2010/02/23 16:55:22 tgl Exp $
2020 *
2121 *-------------------------------------------------------------------------
2222 */
@@ -211,8 +211,7 @@ InitArchiveFmt_Tar(ArchiveHandle *AH)
211211 * positioning.
212212 */
213213if (AH -> compression != 0 )
214- die_horribly (NULL ,modulename ,"compression not supported by tar output format\n" );
215-
214+ die_horribly (NULL ,modulename ,"compression is not supported by tar archive format\n" );
216215}
217216else
218217{/* Read Mode */
@@ -348,25 +347,31 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
348347tm = _tarPositionTo (AH ,filename );
349348if (!tm )/* Not found */
350349{
351- if (filename )/* Couldn't find the requested file. Future:
352- * DO SEEK(0) and retry. */
353- die_horribly (AH ,modulename ,"could not find file %s in archive\n" ,filename );
350+ if (filename )
351+ {
352+ /*
353+ * Couldn't find the requested file. Future:
354+ * do SEEK(0) and retry.
355+ */
356+ die_horribly (AH ,modulename ,"could not find file \"%s\" in archive\n" ,filename );
357+ }
354358else
355- /* Any file OK, non left, so return NULL */
359+ {
360+ /* Any file OK, none left, so return NULL */
356361return NULL ;
362+ }
357363}
358364
359365#ifdef HAVE_LIBZ
360366
361367if (AH -> compression == 0 )
362368tm -> nFH = ctx -> tarFH ;
363369else
364- die_horribly (AH ,modulename ,"compressionsupport isdisabled in this format\n" );
370+ die_horribly (AH ,modulename ,"compression isnot supported by tar archive format\n" );
365371/* tm->zFH = gzdopen(dup(fileno(ctx->tarFH)), "rb"); */
366372#else
367373tm -> nFH = ctx -> tarFH ;
368374#endif
369-
370375}
371376else
372377{
@@ -414,7 +419,6 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
414419tm -> zFH = gzdopen (dup (fileno (tm -> tmpFH )),fmode );
415420if (tm -> zFH == NULL )
416421die_horribly (AH ,modulename ,"could not open temporary file\n" );
417-
418422}
419423else
420424tm -> nFH = tm -> tmpFH ;
@@ -431,7 +435,6 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
431435tm -> tarFH = ctx -> tarFH ;
432436
433437return tm ;
434-
435438}
436439
437440static void
@@ -1150,20 +1153,19 @@ _tarPositionTo(ArchiveHandle *AH, const char *filename)
11501153ahlog (AH ,4 ,"now at file position %s\n" ,buf );
11511154}
11521155
1153- /* We are at the start of the file. or at the next member */
1156+ /* We are at the start of the file, or at the next member */
11541157
11551158/* Get the header */
11561159if (!_tarGetHeader (AH ,th ))
11571160{
11581161if (filename )
1159- die_horribly (AH ,modulename ,"could not find header for file%s in tar archive\n" ,filename );
1162+ die_horribly (AH ,modulename ,"could not find header for file\"%s\" in tar archive\n" ,filename );
11601163else
1161-
1164+ {
11621165/*
1163- * We're just scanning thearchibe for the next file, so return
1166+ * We're just scanning thearchive for the next file, so return
11641167 * null
11651168 */
1166- {
11671169free (th );
11681170return NULL ;
11691171}
@@ -1175,8 +1177,8 @@ _tarPositionTo(ArchiveHandle *AH, const char *filename)
11751177
11761178id = atoi (th -> targetFile );
11771179if ((TocIDRequired (AH ,id ,AH -> ropt )& REQ_DATA )!= 0 )
1178- die_horribly (AH ,modulename ,"dumping data out of order is not supported in this archive format: "
1179- "%s is required, but comes before%s in the archive file.\n" ,
1180+ die_horribly (AH ,modulename ,"restoring data out of order is not supported in this archive format: "
1181+ "\"%s\" is required, but comes before\"%s\" in the archive file.\n" ,
11801182th -> targetFile ,filename );
11811183
11821184/* Header doesn't match, so read to next header */
@@ -1187,8 +1189,7 @@ _tarPositionTo(ArchiveHandle *AH, const char *filename)
11871189_tarReadRaw (AH ,& header [0 ],512 ,NULL ,ctx -> tarFH );
11881190
11891191if (!_tarGetHeader (AH ,th ))
1190- die_horribly (AH ,modulename ,"could not find header for file %s in tar archive\n" ,filename );
1191-
1192+ die_horribly (AH ,modulename ,"could not find header for file \"%s\" in tar archive\n" ,filename );
11921193}
11931194
11941195ctx -> tarNextMember = ctx -> tarFHpos + ((th -> fileLen + 511 )& ~511 );