Version v0.3.45 - -m Fix directory encryption output path - save in same directory as source
This commit is contained in:
@@ -58,14 +58,14 @@ One-time pads can be trivially encrypted and decrypted using pencil and paper, m
|
|||||||
|
|
||||||
### Download Pre-Built Binaries
|
### Download Pre-Built Binaries
|
||||||
|
|
||||||
**[Download Current Linux x86](https://git.laantungir.net/laantungir/otp/releases/download/v0.3.43/otp-v0.3.43-linux-x86_64)**
|
**[Download Current Linux x86](https://git.laantungir.net/laantungir/otp/releases/download/v0.3.44/otp-v0.3.44-linux-x86_64)**
|
||||||
|
|
||||||
**[Download Current Raspberry Pi 64](https://git.laantungir.net/laantungir/otp/releases/download/v0.3.43/otp-v0.3.43-linux-arm64)**
|
**[Download Current Raspberry Pi 64](https://git.laantungir.net/laantungir/otp/releases/download/v0.3.44/otp-v0.3.44-linux-arm64)**
|
||||||
|
|
||||||
After downloading:
|
After downloading:
|
||||||
```bash
|
```bash
|
||||||
# Rename for convenience, then make executable
|
# Rename for convenience, then make executable
|
||||||
mv otp-v0.3.43-linux-x86_64 otp
|
mv otp-v0.3.44-linux-x86_64 otp
|
||||||
chmod +x otp
|
chmod +x otp
|
||||||
|
|
||||||
# Run it
|
# Run it
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
// Version - Updated automatically by build.sh
|
// Version - Updated automatically by build.sh
|
||||||
#define OTP_VERSION "v0.3.43"
|
#define OTP_VERSION "v0.3.44"
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
#define MAX_INPUT_SIZE 4096
|
#define MAX_INPUT_SIZE 4096
|
||||||
|
|||||||
21
src/ui.c
21
src/ui.c
@@ -595,16 +595,23 @@ int handle_directory_encrypt(void) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate default output filename
|
// Generate default output filename in the same directory as the source
|
||||||
char default_output[1024];
|
char default_output[1024];
|
||||||
const char* dir_name = strrchr(dir_path, '/');
|
const char* dir_name = strrchr(dir_path, '/');
|
||||||
if (dir_name) {
|
|
||||||
dir_name++; // Skip the '/'
|
|
||||||
} else {
|
|
||||||
dir_name = dir_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(default_output, sizeof(default_output), "%s.tar.gz.otp", dir_name);
|
if (dir_name) {
|
||||||
|
// Has a path component - save in same directory
|
||||||
|
size_t parent_len = dir_name - dir_path;
|
||||||
|
char parent_dir[1024];
|
||||||
|
strncpy(parent_dir, dir_path, parent_len);
|
||||||
|
parent_dir[parent_len] = '\0';
|
||||||
|
|
||||||
|
dir_name++; // Skip the '/'
|
||||||
|
snprintf(default_output, sizeof(default_output), "%s/%s.tar.gz.otp", parent_dir, dir_name);
|
||||||
|
} else {
|
||||||
|
// No path component - save in current directory
|
||||||
|
snprintf(default_output, sizeof(default_output), "%s.tar.gz.otp", dir_path);
|
||||||
|
}
|
||||||
|
|
||||||
// Get output filename
|
// Get output filename
|
||||||
char output_file[512];
|
char output_file[512];
|
||||||
|
|||||||
Reference in New Issue
Block a user