Preserve ifs when calling other functions after temporary altering it. Fixes a couple of minor bugs.
Added difs env var that can be used anywhere to restore default ifs.
This commit is contained in:
parent
d12c13ee25
commit
c9b9e4e9bf
4 changed files with 4 additions and 3 deletions
|
|
@ -16,7 +16,7 @@ fn statpost {
|
||||||
#mdate=`{/bin/date -Rd `{mtime $f|awk '{print $1}' }} # Not used because it is unreliable
|
#mdate=`{/bin/date -Rd `{mtime $f|awk '{print $1}' }} # Not used because it is unreliable
|
||||||
by=$stat(2)
|
by=$stat(2)
|
||||||
#ifs=() { summary=`{cat $f/index.md | crop_text 1024 ... | $formatter } }
|
#ifs=() { summary=`{cat $f/index.md | crop_text 1024 ... | $formatter } }
|
||||||
ifs=() { summary=`{cat $f/index.md | $formatter } }
|
ifs=() { summary=`{cat $f/index.md | ifs=$difs {$formatter} } }
|
||||||
}
|
}
|
||||||
updated = `{/bin/date --rfc-3339'=seconds' |sed 's/ /T/'}
|
updated = `{/bin/date --rfc-3339'=seconds' |sed 's/ /T/'}
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ fn statpost {
|
||||||
#mdate=`{/bin/date -Rd $stat(1)} # Not used because it is unreliable
|
#mdate=`{/bin/date -Rd $stat(1)} # Not used because it is unreliable
|
||||||
post_uri=$base_url^`{cleanname `{echo $f | sed -e 's!^'$sitedir'!!'}}^'/'
|
post_uri=$base_url^`{cleanname `{echo $f | sed -e 's!^'$sitedir'!!'}}^'/'
|
||||||
by=$stat(2)
|
by=$stat(2)
|
||||||
ifs=() { summary=`{cat $f/index.md | $formatter | escape_html} }
|
ifs=() {summary=`{ cat $f/index.md | ifs=$difs {$formatter | escape_html} }}
|
||||||
}
|
}
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
forbidden_uri_chars='[^a-zA-Z0-9_+\-\/\.,:]'
|
forbidden_uri_chars='[^a-zA-Z0-9_+\-\/\.,:]'
|
||||||
|
difs=$ifs # Used to restore default ifs when needed
|
||||||
|
|
||||||
# Expected input: ls -F style, $sitedir/path/to/files/
|
# Expected input: ls -F style, $sitedir/path/to/files/
|
||||||
# <ls -F+x><symlink hack><Useless?><hiden files >
|
# <ls -F+x><symlink hack><Useless?><hiden files >
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ fn get_user {
|
||||||
get_post_args user_name user_password
|
get_post_args user_name user_password
|
||||||
|
|
||||||
if(~ $#user_name 0) {
|
if(~ $#user_name 0) {
|
||||||
ifs=':' { cu=`{get_cookie werc_user|tr -d $NEW_LINE} }
|
ifs=':' { cu=`{ifs=$difs {get_cookie werc_user} | tr -d $NEW_LINE} }
|
||||||
if(! ~ $#cu 0) {
|
if(! ~ $#cu 0) {
|
||||||
user_name=$cu(1)
|
user_name=$cu(1)
|
||||||
user_password=$cu(3)
|
user_password=$cu(3)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue