runProgram(): Distinguish between empty input and no input
For example, if we call brotli with an empty input, it shouldn't read from the caller's stdin.
This commit is contained in:
		
							parent
							
								
									042975ea8e
								
							
						
					
					
						commit
						25dff2b7db
					
				
					 5 changed files with 30 additions and 15 deletions
				
			
		| 
						 | 
				
			
			@ -170,10 +170,10 @@ int main(int argc, char * * argv)
 | 
			
		|||
                Path unpacked = (Path) tmpDir + "/unpacked";
 | 
			
		||||
                createDirs(unpacked);
 | 
			
		||||
                if (hasSuffix(baseNameOf(uri), ".zip"))
 | 
			
		||||
                    runProgram("unzip", true, {"-qq", tmpFile, "-d", unpacked}, "");
 | 
			
		||||
                    runProgram("unzip", true, {"-qq", tmpFile, "-d", unpacked});
 | 
			
		||||
                else
 | 
			
		||||
                    // FIXME: this requires GNU tar for decompression.
 | 
			
		||||
                    runProgram("tar", true, {"xf", tmpFile, "-C", unpacked}, "");
 | 
			
		||||
                    runProgram("tar", true, {"xf", tmpFile, "-C", unpacked});
 | 
			
		||||
 | 
			
		||||
                /* If the archive unpacks to a single file/directory, then use
 | 
			
		||||
                   that as the top-level. */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue