shithub: werc

Download patch

ref: eca96ac1cc8e77830c02fa8c46ebfde2829092f6
parent: f068315701cf800f7a96d9fcb54af5152ca4f92b
author: uriel <[email protected]>
date: Fri Jan 2 11:49:44 EST 2009

Minnor change, merge two lines and add a comment from the old blog code.

--- a/apps/blagh/app.rc
+++ b/apps/blagh/app.rc
@@ -38,6 +38,7 @@
 }
 
 fn get_post_list {
-    d=$*^/./[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]/ 
-    ls  -F $d >[2]/dev/null | sed -n 's,/\./,/|/,; /\/$/p' | sort -r '-t|' +1 | sed 's,/+\|/+,/,'
+    # the /./->/|/ are added so we can sort -t| and order only the file name
+    # NOTE: this breaks if any path element in blogDirs contain '/./' or '|'
+    ls -F $*^/./[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]/ >[2]/dev/null | sed -n 's,/\./,/|/,; /\/$/p' | sort -r '-t|' +1 | sed 's,/+\|/+,/,'
 }