Explorar o código

Do not use empty binary names

timvisee %!s(int64=6) %!d(string=hai) anos
pai
achega
32e0e1c48f
Modificáronse 2 ficheiros con 9 adicións e 6 borrados
  1. 7 5
      README.md
  2. 2 1
      src/util.rs

+ 7 - 5
README.md

@@ -111,6 +111,7 @@ Expiry:     18h2m (64928s)
 ```
 
 Other commands include:
+
 ```bash
 # View your file history
 $ ffsend history
@@ -147,9 +148,6 @@ all available subcommands.
   - OpenSSL: `brew install openssl@1.1`
 
 ## Install
-<!-- Before installing, make sure you meet all requirements listed
-[here](#requirements) -->
-
 Because `ffsend` is still in alpha, only limited installation options are
 available right now.
 
@@ -199,8 +197,8 @@ ffsend --help
 
 #### Linux: Nix package
 _Note: The Nix package is currently not automatically updated, therefore it
-might be slightly outdated. Open an issue if you believe an important new
-feature is missing._
+might be slightly outdated. Open an issue if you believe an important update
+is missing._
 
 ```bash
 nix-channel --update
@@ -341,10 +339,14 @@ docker run --rm -it -v $(pwd):/data timvisee/ffsend download https://send.firefo
 
 # Show help
 docker run --rm -it -v $(pwd):/data timvisee/ffsend help
+
+# To update the used image
+docker pull timvisee/ffsend
 ```
 
 On Linux or macOS you might define a alias in your shell configuration, to make
 it invokable as `ffsend`:
+
 ```bash
 alias ffsend='docker run --rm -it -v "$(pwd):/data" timvisee/ffsend'
 ```

+ 2 - 1
src/util.rs

@@ -755,7 +755,8 @@ pub fn format_bool(b: bool) -> &'static str {
 pub fn bin_name() -> String {
     env::args_os()
         .next()
-        .map(|path| PathBuf::from(path))
+        .filter(|path| !path.is_empty())
+        .map(PathBuf::from)
         .or_else(|| current_exe().ok())
         .and_then(|p| p.file_name().map(|n| n.to_owned()))
         .and_then(|n| n.into_string().ok())