mirror of
				https://github.com/pbatard/rufus.git
				synced 2024-08-14 23:57:05 +00:00 
			
		
		
		
	[iso9660] remove warnings about directory size mismatch
* also minor improvements to iso.c
This commit is contained in:
		
							parent
							
								
									7fbcccdc65
								
							
						
					
					
						commit
						41e8ac7d52
					
				
					 3 changed files with 14 additions and 36 deletions
				
			
		
							
								
								
									
										10
									
								
								src/iso.c
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								src/iso.c
									
										
									
									
									
								
							|  | @ -86,22 +86,27 @@ static void udf_list_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const char | ||||||
| 
 | 
 | ||||||
| static void iso_list_files(iso9660_t* p_iso, const char *psz_path) | static void iso_list_files(iso9660_t* p_iso, const char *psz_path) | ||||||
| { | { | ||||||
| 	int i = 0; |  | ||||||
| 	char filename[4096], *p; | 	char filename[4096], *p; | ||||||
| 	CdioListNode_t* p_entnode; | 	CdioListNode_t* p_entnode; | ||||||
| 	iso9660_stat_t *p_statbuf; | 	iso9660_stat_t *p_statbuf; | ||||||
| 	CdioList_t* p_entlist; | 	CdioList_t* p_entlist; | ||||||
|  | 
 | ||||||
|  | 	if ( (p_iso == NULL) || (psz_path == NULL)) | ||||||
|  | 		return; | ||||||
|  | 
 | ||||||
| 	strncpy(filename, psz_path, 4094); | 	strncpy(filename, psz_path, 4094); | ||||||
| 	p = &filename[strlen(psz_path)]; | 	p = &filename[strlen(psz_path)]; | ||||||
| 	*p++ = '/'; | 	*p++ = '/'; | ||||||
| 	*p = 0; | 	*p = 0; | ||||||
| 	p_entlist = iso9660_ifs_readdir(p_iso, psz_path); | 	p_entlist = iso9660_ifs_readdir(p_iso, psz_path); | ||||||
|  | 
 | ||||||
| 	if (!p_entlist) | 	if (!p_entlist) | ||||||
| 		return; | 		return; | ||||||
| 
 | 
 | ||||||
| 	_CDIO_LIST_FOREACH (p_entnode, p_entlist) { | 	_CDIO_LIST_FOREACH (p_entnode, p_entlist) { | ||||||
| 		p_statbuf = (iso9660_stat_t*) _cdio_list_node_data(p_entnode); | 		p_statbuf = (iso9660_stat_t*) _cdio_list_node_data(p_entnode); | ||||||
| 		if (i++ < 2) | 		if ( (strcmp(p_statbuf->filename, ".") == 0) | ||||||
|  | 		  || (strcmp(p_statbuf->filename, "..") == 0) ) | ||||||
| 			continue;	// Eliminate . and .. entries
 | 			continue;	// Eliminate . and .. entries
 | ||||||
| 		iso9660_name_translate(p_statbuf->filename, p); | 		iso9660_name_translate(p_statbuf->filename, p); | ||||||
| 		uprintf("%s [LSN %6d] %8u %s\n", (p_statbuf->type == _STAT_DIR)?"d":"-", | 		uprintf("%s [LSN %6d] %8u %s\n", (p_statbuf->type == _STAT_DIR)?"d":"-", | ||||||
|  | @ -227,6 +232,7 @@ int main(int argc, char** argv) | ||||||
| { | { | ||||||
| //	ExtractISO("D:\\Incoming\\GRMSDKX_EN_DVD.iso", NULL);
 | //	ExtractISO("D:\\Incoming\\GRMSDKX_EN_DVD.iso", NULL);
 | ||||||
| 	ExtractISO("D:\\fd11src.iso", NULL); | 	ExtractISO("D:\\fd11src.iso", NULL); | ||||||
|  | //	ExtractISO("D:\\Incoming\\en_windows_driver_kit_3790.iso", NULL);
 | ||||||
| //	ExtractISO("D:\\Incoming\\en_windows_7_ultimate_with_sp1_x64_dvd_618240.iso", NULL);
 | //	ExtractISO("D:\\Incoming\\en_windows_7_ultimate_with_sp1_x64_dvd_618240.iso", NULL);
 | ||||||
| //	ExtractISO("D:\\Incoming\\Windows 8 Preview\\WindowsDeveloperPreview-64bit-English-Developer.iso", NULL);
 | //	ExtractISO("D:\\Incoming\\Windows 8 Preview\\WindowsDeveloperPreview-64bit-English-Developer.iso", NULL);
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -987,13 +987,6 @@ _fs_stat_traverse (const CdIo_t *p_cdio, const iso9660_stat_t *_root, | ||||||
| 
 | 
 | ||||||
|   cdio_assert (_root->type == _STAT_DIR); |   cdio_assert (_root->type == _STAT_DIR); | ||||||
| 
 | 
 | ||||||
|   if (_root->size != ISO_BLOCKSIZE * _root->secsize) |  | ||||||
|     { |  | ||||||
|       cdio_warn ("bad size for ISO9660 directory (%ud) should be (%lu)!", |  | ||||||
| 		 (unsigned) _root->size,  |  | ||||||
| 		 (unsigned long int) ISO_BLOCKSIZE * _root->secsize); |  | ||||||
|     } |  | ||||||
|    |  | ||||||
|   _dirbuf = calloc(1, _root->secsize * ISO_BLOCKSIZE); |   _dirbuf = calloc(1, _root->secsize * ISO_BLOCKSIZE); | ||||||
|   if (!_dirbuf) |   if (!_dirbuf) | ||||||
|     { |     { | ||||||
|  | @ -1092,13 +1085,6 @@ _fs_iso_stat_traverse (iso9660_t *p_iso, const iso9660_stat_t *_root, | ||||||
|     return NULL; |     return NULL; | ||||||
| 
 | 
 | ||||||
|   cdio_assert (_root->type == _STAT_DIR); |   cdio_assert (_root->type == _STAT_DIR); | ||||||
| 
 |  | ||||||
|   if (_root->size != ISO_BLOCKSIZE * _root->secsize) |  | ||||||
|     { |  | ||||||
|       cdio_warn ("bad size for ISO9660 directory (%ud) should be (%lu)!", |  | ||||||
| 		 (unsigned) _root->size,  |  | ||||||
| 		 (unsigned long int) ISO_BLOCKSIZE * _root->secsize); |  | ||||||
|     } |  | ||||||
|    |    | ||||||
|   _dirbuf = calloc(1, _root->secsize * ISO_BLOCKSIZE); |   _dirbuf = calloc(1, _root->secsize * ISO_BLOCKSIZE); | ||||||
|   if (!_dirbuf) |   if (!_dirbuf) | ||||||
|  | @ -1306,13 +1292,6 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[], bool b_mode2) | ||||||
|     uint8_t *_dirbuf = NULL; |     uint8_t *_dirbuf = NULL; | ||||||
|     CdioList_t *retval = _cdio_list_new (); |     CdioList_t *retval = _cdio_list_new (); | ||||||
| 
 | 
 | ||||||
|     if (p_stat->size != ISO_BLOCKSIZE * p_stat->secsize) |  | ||||||
|       { |  | ||||||
| 	cdio_warn ("bad size for ISO9660 directory (%ud) should be (%lu)!", |  | ||||||
| 		   (unsigned) p_stat->size,  |  | ||||||
| 		   (unsigned long int) ISO_BLOCKSIZE * p_stat->secsize); |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|     _dirbuf = calloc(1, p_stat->secsize * ISO_BLOCKSIZE); |     _dirbuf = calloc(1, p_stat->secsize * ISO_BLOCKSIZE); | ||||||
|     if (!_dirbuf) |     if (!_dirbuf) | ||||||
|       { |       { | ||||||
|  | @ -1377,13 +1356,6 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]) | ||||||
|     uint8_t *_dirbuf = NULL; |     uint8_t *_dirbuf = NULL; | ||||||
|     CdioList_t *retval = _cdio_list_new (); |     CdioList_t *retval = _cdio_list_new (); | ||||||
| 
 | 
 | ||||||
|     if (p_stat->size != ISO_BLOCKSIZE * p_stat->secsize) |  | ||||||
|       { |  | ||||||
| 	cdio_warn ("bad size for ISO9660 directory (%ud) should be (%lu)!", |  | ||||||
| 		   (unsigned int) p_stat->size,  |  | ||||||
| 		   (unsigned long int) ISO_BLOCKSIZE * p_stat->secsize); |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|     _dirbuf = calloc(1, p_stat->secsize * ISO_BLOCKSIZE); |     _dirbuf = calloc(1, p_stat->secsize * ISO_BLOCKSIZE); | ||||||
|     if (!_dirbuf) |     if (!_dirbuf) | ||||||
|       { |       { | ||||||
|  |  | ||||||
							
								
								
									
										12
									
								
								src/rufus.rc
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								src/rufus.rc
									
										
									
									
									
								
							|  | @ -33,7 +33,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL | ||||||
| IDD_DIALOG DIALOGEX 12, 12, 206, 278 | IDD_DIALOG DIALOGEX 12, 12, 206, 278 | ||||||
| STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||||
| EXSTYLE WS_EX_APPWINDOW | EXSTYLE WS_EX_APPWINDOW | ||||||
| CAPTION "Rufus v1.0.7.136" | CAPTION "Rufus v1.0.7.137" | ||||||
| FONT 8, "MS Shell Dlg", 400, 0, 0x1 | FONT 8, "MS Shell Dlg", 400, 0, 0x1 | ||||||
| BEGIN | BEGIN | ||||||
|     DEFPUSHBUTTON   "Start",IDC_START,94,236,50,14 |     DEFPUSHBUTTON   "Start",IDC_START,94,236,50,14 | ||||||
|  | @ -70,7 +70,7 @@ BEGIN | ||||||
|     DEFPUSHBUTTON   "OK",IDOK,231,175,50,14,WS_GROUP |     DEFPUSHBUTTON   "OK",IDOK,231,175,50,14,WS_GROUP | ||||||
|     CONTROL         "<a href=""http://rufus.akeo.ie"">http://rufus.akeo.ie</a>",IDC_ABOUT_RUFUS_URL, |     CONTROL         "<a href=""http://rufus.akeo.ie"">http://rufus.akeo.ie</a>",IDC_ABOUT_RUFUS_URL, | ||||||
|                     "SysLink",WS_TABSTOP,46,47,114,9 |                     "SysLink",WS_TABSTOP,46,47,114,9 | ||||||
|     LTEXT           "Version 1.0.7 (Build 136)",IDC_STATIC,46,19,78,8 |     LTEXT           "Version 1.0.7 (Build 137)",IDC_STATIC,46,19,78,8 | ||||||
|     PUSHBUTTON      "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP |     PUSHBUTTON      "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP | ||||||
|     EDITTEXT        IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL |     EDITTEXT        IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL | ||||||
|     LTEXT           "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8 |     LTEXT           "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8 | ||||||
|  | @ -208,8 +208,8 @@ END | ||||||
| // | // | ||||||
| 
 | 
 | ||||||
| VS_VERSION_INFO VERSIONINFO | VS_VERSION_INFO VERSIONINFO | ||||||
|  FILEVERSION 1,0,7,136 |  FILEVERSION 1,0,7,137 | ||||||
|  PRODUCTVERSION 1,0,7,136 |  PRODUCTVERSION 1,0,7,137 | ||||||
|  FILEFLAGSMASK 0x3fL |  FILEFLAGSMASK 0x3fL | ||||||
| #ifdef _DEBUG | #ifdef _DEBUG | ||||||
|  FILEFLAGS 0x1L |  FILEFLAGS 0x1L | ||||||
|  | @ -226,13 +226,13 @@ BEGIN | ||||||
|         BEGIN |         BEGIN | ||||||
|             VALUE "CompanyName", "akeo.ie" |             VALUE "CompanyName", "akeo.ie" | ||||||
|             VALUE "FileDescription", "Rufus" |             VALUE "FileDescription", "Rufus" | ||||||
|             VALUE "FileVersion", "1.0.7.136" |             VALUE "FileVersion", "1.0.7.137" | ||||||
|             VALUE "InternalName", "Rufus" |             VALUE "InternalName", "Rufus" | ||||||
|             VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)" |             VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)" | ||||||
|             VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" |             VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" | ||||||
|             VALUE "OriginalFilename", "rufus.exe" |             VALUE "OriginalFilename", "rufus.exe" | ||||||
|             VALUE "ProductName", "Rufus" |             VALUE "ProductName", "Rufus" | ||||||
|             VALUE "ProductVersion", "1.0.7.136" |             VALUE "ProductVersion", "1.0.7.137" | ||||||
|         END |         END | ||||||
|     END |     END | ||||||
|     BLOCK "VarFileInfo" |     BLOCK "VarFileInfo" | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue