projects
/
anondcim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1ff613c
)
use dirname instead of string handling
author
fpunktk
<git@fpunktk.de>
Sat, 30 Dec 2017 11:26:31 +0000
(12:26 +0100)
committer
fpunktk
<git@fpunktk.de>
Sat, 30 Dec 2017 11:26:31 +0000
(12:26 +0100)
anondcim
patch
|
blob
|
history
diff --git
a/anondcim
b/anondcim
index 027ccc6822823be3931925eb07f0a070fd9c1ab4..feae7667ffaa2845f607ea6f09fa152fb0ca02aa 100755
(executable)
--- a/
anondcim
+++ b/
anondcim
@@
-73,11
+73,12
@@
do
#
if [ "$dst_dir" = "--same--" ]
then
#
if [ "$dst_dir" = "--same--" ]
then
- #
if the filename contains a "/" then use this dir
-
[ "$fn" != "${fn%/*}" ] && dst="${fn%/*}/" || dst="
"
+ #
use the directory of the source file
+
dst="$(dirname "$fn")/
"
else
dst="$dst_dir"
fi
else
dst="$dst_dir"
fi
+ #
# always use a padded number as destination filename suffix
dst_jpg="$dst$file_prefix$(echo -n "0000000000$cur" | tail -c ${#total}).jpg"
while [ -e "$dst_jpg" ] && [ $addend -lt 1000 ]
# always use a padded number as destination filename suffix
dst_jpg="$dst$file_prefix$(echo -n "0000000000$cur" | tail -c ${#total}).jpg"
while [ -e "$dst_jpg" ] && [ $addend -lt 1000 ]