mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 00:59:02 +03:00
fix: incorrect seperator for zip archives under windows (#577)
This commit is contained in:
@@ -37,7 +37,7 @@ use std::collections::HashMap;
|
|||||||
use std::fs::Metadata;
|
use std::fs::Metadata;
|
||||||
use std::io::SeekFrom;
|
use std::io::SeekFrom;
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::path::{Component, Path, PathBuf};
|
use std::path::{Component, Path, PathBuf, MAIN_SEPARATOR};
|
||||||
use std::sync::atomic::{self, AtomicBool};
|
use std::sync::atomic::{self, AtomicBool};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::SystemTime;
|
use std::time::SystemTime;
|
||||||
@@ -1644,7 +1644,12 @@ async fn zip_dir<W: AsyncWrite + Unpin>(
|
|||||||
))
|
))
|
||||||
.await?;
|
.await?;
|
||||||
for zip_path in zip_paths.into_iter() {
|
for zip_path in zip_paths.into_iter() {
|
||||||
let filename = match zip_path.strip_prefix(dir).ok().and_then(|v| v.to_str()) {
|
let filename = match zip_path
|
||||||
|
.strip_prefix(dir)
|
||||||
|
.ok()
|
||||||
|
.and_then(|v| v.to_str())
|
||||||
|
.map(|v| v.replace(MAIN_SEPARATOR, "/"))
|
||||||
|
{
|
||||||
Some(v) => v,
|
Some(v) => v,
|
||||||
None => continue,
|
None => continue,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user