Skip to content

Commit b8ae481

Browse files
committed
version 8.0.1, fix path handling bug in #53
1 parent f0ea498 commit b8ae481

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Flying Carpet/src-tauri/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "flying-carpet"
3-
version = "8.0.0"
3+
version = "8.0.1"
44
description = "Encrypted file transfer over ad hoc WiFi between Android, iOS, Linux, macOS, and Windows"
55
authors = ["Theron Spiegl"]
66
license = "GPL-3.0-only"

Flying Carpet/src-tauri/tauri.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"package": {
1010
"productName": "FlyingCarpet",
11-
"version": "8.0.0"
11+
"version": "8.0.1"
1212
},
1313
"tauri": {
1414
"allowlist": {

Flying Carpet/src/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,9 @@ window.modeChange = modeChange;
383383
window.peerChange = peerChange;
384384

385385
const aboutMessage = `https://flyingcarpet.spiegl.dev
386-
Version: 8.0
386+
Version: 8.0.1
387387
388-
Copyright (c) 2023, Theron Spiegl
388+
Copyright (c) 2024, Theron Spiegl
389389
All rights reserved.
390390
391391
Flying Carpet performs file transfers between two laptops or phones (Android, iOS, Linux, Mac, Windows) via ad hoc WiFi. No access point or network gear is required. Just select a file, whether each device is sending or receiving, and the operating system of the other device. For mobile versions, search for "Flying Carpet File Transfer" in the Apple App Store or Google Play Store.

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2023, Theron Spiegl
1+
Copyright (c) 2024, Theron Spiegl
22
All rights reserved.
33

44
GNU GENERAL PUBLIC LICENSE

core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "flying-carpet-core"
3-
version = "8.0.0"
3+
version = "8.0.1"
44
edition = "2021"
55
license = "GPL-3.0-only"
66

core/src/lib.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use sha2::{Digest, Sha256};
1010
use std::{
1111
error::Error,
1212
net::SocketAddr,
13-
path::PathBuf,
13+
path::{PathBuf, Path},
1414
str::FromStr,
1515
sync::{Arc, Mutex},
1616
};
@@ -178,16 +178,19 @@ pub async fn start_transfer<T: UI>(
178178
}
179179
}
180180
// find folder common to all files
181-
let mut common_folder = files[0].parent().expect("file has no parent");
181+
let mut common_folder = files[0].parent().or(Some(Path::new(""))).unwrap();
182182
if files.len() > 1 {
183183
for file in &files[1..] {
184-
let current = file.parent().expect("file has no parent");
185-
if current.components().collect::<Vec<_>>().len() < common_folder.components().collect::<Vec<_>>().len() {
184+
let current = file.parent().or(Some(Path::new(""))).unwrap();
185+
let current_len = current.components().collect::<Vec<_>>().len();
186+
let common_len = common_folder.components().collect::<Vec<_>>().len();
187+
if current_len < common_len {
186188
common_folder = current;
189+
} else if current_len == common_len {
190+
common_folder = current.parent().or(Some(Path::new(""))).unwrap();
187191
}
188192
}
189193
}
190-
ui.output(&format!("common folder: {}", common_folder.display()));
191194
// send files
192195
for (i, file) in files.iter().enumerate() {
193196
let file_name = file

0 commit comments

Comments
 (0)