Fix builtins.readDir on XFS
The DT_UNKNOWN fallback code was getting the type of the wrong path, causing readDir to report "directory" as the type of every file. Reported by deepfire on IRC.
This commit is contained in:
		
							parent
							
								
									57d64d24aa
								
							
						
					
					
						commit
						2a3b1df423
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -796,7 +796,7 @@ static void prim_readDir(EvalState & state, const Pos & pos, Value * * args, Val | ||||||
|     for (auto & ent : entries) { |     for (auto & ent : entries) { | ||||||
|         Value * ent_val = state.allocAttr(v, state.symbols.create(ent.name)); |         Value * ent_val = state.allocAttr(v, state.symbols.create(ent.name)); | ||||||
|         if (ent.type == DT_UNKNOWN) |         if (ent.type == DT_UNKNOWN) | ||||||
|             ent.type = getFileType(path); |             ent.type = getFileType(path + "/" + ent.name); | ||||||
|         mkStringNoCopy(*ent_val, |         mkStringNoCopy(*ent_val, | ||||||
|             ent.type == DT_REG ? "regular" : |             ent.type == DT_REG ? "regular" : | ||||||
|             ent.type == DT_DIR ? "directory" : |             ent.type == DT_DIR ? "directory" : | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue