src/pxar/decoder.rs: Add comment for unsolved issue and refactor if statement.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
		
				
					committed by
					
						
						Dietmar Maurer
					
				
			
			
				
	
			
			
			
						parent
						
							2a05048b93
						
					
				
				
					commit
					132cb0d0db
				
			@ -98,6 +98,10 @@ impl<R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> Decoder<R, F> {
 | 
				
			|||||||
        let head: PxarHeader = self.inner.read_item()?;
 | 
					        let head: PxarHeader = self.inner.read_item()?;
 | 
				
			||||||
        if head.htype == PXAR_FORMAT_HARDLINK {
 | 
					        if head.htype == PXAR_FORMAT_HARDLINK {
 | 
				
			||||||
            let (_, offset) = self.inner.read_hardlink(head.size)?;
 | 
					            let (_, offset) = self.inner.read_hardlink(head.size)?;
 | 
				
			||||||
 | 
					            // TODO: Howto find correct end offset for hardlink target?
 | 
				
			||||||
 | 
					            // This is a bit tricky since we cannot find correct end in an efficient
 | 
				
			||||||
 | 
					            // way, on the other hand it doesn't really matter (for now) since target
 | 
				
			||||||
 | 
					            // is never a directory and end is not used in such cases.
 | 
				
			||||||
            return self.read_directory_entry(start - offset, end);
 | 
					            return self.read_directory_entry(start - offset, end);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        check_ca_header::<PxarEntry>(&head, PXAR_ENTRY)?;
 | 
					        check_ca_header::<PxarEntry>(&head, PXAR_ENTRY)?;
 | 
				
			||||||
@ -231,14 +235,10 @@ impl<R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> Decoder<R, F> {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            writeln!(output, "{:?}", prefix)?;
 | 
					            writeln!(output, "{:?}", prefix)?;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ifmt == libc::S_IFDIR {
 | 
					            match ifmt {
 | 
				
			||||||
                self.print_filenames(output, prefix, item)?;
 | 
					                libc::S_IFDIR => self.print_filenames(output, prefix, item)?,
 | 
				
			||||||
            } else if ifmt == libc::S_IFREG {
 | 
					                libc::S_IFREG | libc::S_IFLNK | libc::S_IFBLK | libc::S_IFCHR => {}
 | 
				
			||||||
            } else if ifmt == libc::S_IFLNK {
 | 
					                _ => bail!("unknown item mode/type for {:?}", prefix),
 | 
				
			||||||
            } else if ifmt == libc::S_IFBLK {
 | 
					 | 
				
			||||||
            } else if ifmt == libc::S_IFCHR {
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
                bail!("unknown item mode/type for {:?}", prefix);
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            prefix.pop();
 | 
					            prefix.pop();
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user