small pixel drawing of a pufferfish pa

forbid trailing '/' in password names

dirname strips them, which is expected, but then age is unable to save
file due to missing parent directory.

before switching to dirname, pa used to create ".age" file under the
password name, which is probably a mistake, and it's unclear what the
user intent would be there, so best to just avoid it altogether.

also, reword 'Category' -> 'Name' because category is part of the name
and the error sounds clearer this way: the user may not know that they
create a "category" by typing an errant slash.
arĉi arcxi@dismail.de
Sat, 22 Jun 2024 14:56:49 +0200
commit

58d8f67ceb93daa98ade52e32dcb1c6b7bff92ef

parent

0bc99b279e3aa58b64da9f31fa8733add8e5027e

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M papa

@@ -259,8 +259,8 @@

glob "$1" 'a*' && [ -f "$2.age" ] && die "Password '$2' already exists" - glob "$2" '/*' && - die "Category can't start with '/'" + glob "$2" '/*' || glob "$2" '*/' && + die "Name can't start or end with '/'" glob "$2" '../*' || glob "$2" '*/../*' && die "Category went out of bounds"