diff --git a/common/step_create_floppy.go b/common/step_create_floppy.go index 273be1bc4..6bccc9fc4 100644 --- a/common/step_create_floppy.go +++ b/common/step_create_floppy.go @@ -222,7 +222,7 @@ func (s *StepCreateFloppy) Add(dircache directoryCache, src string) error { return err } - entry, err := d.AddFile(path.Base(src)) + entry, err := d.AddFile(path.Base(filepath.ToSlash(src))) if err != nil { return err } @@ -251,9 +251,9 @@ func (s *StepCreateFloppy) Add(dircache directoryCache, src string) error { _, err = dircache(filepath.ToSlash(base)) return err } - directory, filename := filepath.Split(pathname) + directory, filename := filepath.Split(filepath.ToSlash(pathname)) - base, err := removeBase(basedirectory, directory) + base, err := removeBase(basedirectory, filepath.FromSlash(directory)) if err != nil { return err } @@ -337,7 +337,10 @@ func fsDirectoryCache(rootDirectory fs.Directory) directoryCache { Input, Output, Error := make(chan string), make(chan fs.Directory), make(chan error) go func(Error chan error) { for { - input := path.Clean(<-Input) + input := <-Input + if len(input) > 0 { + input = path.Clean(input) + } // found a directory, so yield it res, ok := cache[input]