[alt.sources] Patch#3 for unzipbsd

michaele@vice.ICO.TEK.COM (Michael Enkelis) (05/25/89)

This decodes the "end central directory" record for a zip file.
The file comment is now displayed (if one is found).



*** unzipbsd.c	Wed May 24 10:21:40 1989
--- ../unzipbsd.c	Wed May 24 10:17:19 1989
***************
*** 1048,1053 ****
--- 1048,1063 ----
  
  	if (debugging) {
  	printf("\n\nProcess END_CENTRAL directory header.\n");
+ 	printf("This disk       : %d\n",rec.number_this_disk);
+ 	printf("Starting disk	: %d\n",
+ 		rec.number_disk_with_start_central_directory);
+ 	printf("Total this disk	: %d\n",
+ 		rec.total_entries_central_dir_on_this_disk);
+ 	printf("Total entries	: %d\n",rec.total_entries_central_dir);
+ 	printf("Central dir size: %d\n",rec.size_central_directory);
+ 	printf("Offset to dir   : %d\n",rec.offset_start_central_directory);
+ 	printf("Comment size    : %d\n",rec.zipfile_comment_length);
+ 	printf("Comment         : %s\n",comment); 
  	}
  }
  
***************
*** 1084,1095 ****
  		{
  			process_end_central_dir(); 
  			if (test_zip) {
! 			if (numbad < 1)
  				printf("No errors detected\n");
! 			else
! 			if (numbad == 1)
  				printf("One error detected\n");
! 			else
  				printf("%d errors detected\n",numbad);
  			}
  			if (list_zip) {
--- 1094,1105 ----
  		{
  			process_end_central_dir(); 
  			if (test_zip) {
! 			 if (numbad < 1)
  				printf("No errors detected\n");
! 			 else
! 			 if (numbad == 1)
  				printf("One error detected\n");
! 			 else
  				printf("%d errors detected\n",numbad);
  			}
  			if (list_zip) {
***************
*** 1102,1108 ****
  					Total_bytes);
  			else
  				printf("---\n");
- 
  			 } else {
  			 printf("        ====  ========\n");
  			 printf("Total:  %4d  %8d\n",
--- 1112,1117 ----
***************
*** 1109,1114 ****
--- 1118,1125 ----
  				Total_files,Total_bytes);
  			 }
  			}
+ 			if (strlen(comment))
+ 				printf("%s\n",comment); 
  			return;
  		} 
  	else 
-- 
 _ _ _                          __
' ) ) )      /          /)     /  `       /      /)	Michael Enkelis
 / / / o _. /_  __. _  //     /--   __   /_  _  // o _ 	tektronix!vice!michaele
/ ' (_(_(__/ /_(_(_(<_(/_    (___, /) )_/ <_(<_(/_(_/_)_    (503) 627-4099