fix(windows): encode colons in project state file path
This commit is contained in:
		
							parent
							
								
									5eeeb837ad
								
							
						
					
					
						commit
						8abc9c0ee1
					
				
					 1 changed files with 7 additions and 6 deletions
				
			
		| 
						 | 
					@ -401,13 +401,14 @@ const Process = struct {
 | 
				
			||||||
            error.PathAlreadyExists => {},
 | 
					            error.PathAlreadyExists => {},
 | 
				
			||||||
            else => return e,
 | 
					            else => return e,
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
        var pos: usize = 0;
 | 
					        for (path) |c| {
 | 
				
			||||||
        while (std.mem.indexOfScalarPos(u8, path, pos, std.fs.path.sep)) |next| {
 | 
					            _ = if (std.fs.path.isSep(c))
 | 
				
			||||||
            _ = try writer.write(path[pos..next]);
 | 
					                try writer.write("__")
 | 
				
			||||||
            _ = try writer.write("__");
 | 
					            else if (c == ':')
 | 
				
			||||||
            pos = next + 1;
 | 
					                try writer.write("___")
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                try writer.writeByte(c);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        _ = try writer.write(path[pos..]);
 | 
					 | 
				
			||||||
        return stream.toOwnedSlice();
 | 
					        return stream.toOwnedSlice();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue