Ticket #3729: extfs: hp48: fix date format.

Use "MM-DD-YYYY hh:mm" instead of "Mon DD YYYY hh:mm".

Note: we assign to $NOW at the top-level, not inside hp48_parser(), because the
communication is slow and we don't want each recursive call to hp48_parser() to
potentially print a different time.
This commit is contained in:
Mooffie 2016-12-13 01:05:55 +02:00 committed by Yury V. Zaytsev
parent 019ab5c012
commit c91476ac4a

View File

@ -24,6 +24,8 @@
AWK=@AWK@
KERMIT="kermit -l /dev/ttyS1 -b 9600"
NOW=`date +"%m-%d-%Y %H:%M"`
hp48_cmd()
{
$KERMIT -C "SET EXIT WARNING OFF,REMOTE $1,QUIT"
@ -78,8 +80,8 @@ while [ "x$INPUT" != "xEOF" ]
do
case `echo "$INPUT" | $AWK '{if (int($2)) if ($3 == "Directory") print "dir";else print "file"}'` in
dir) HP48_DIRS="$HP48_DIRS `hp48_retdir $INPUT`"
printf "drwxr-xr-x 1 %-8d %-8d %8d %s %s\n" 0 0 `hp48_retsize $INPUT` "`date +\"%b %d %Y %k:%M\"`" "$HP48_CDIR/`hp48_retdir $INPUT`";;
file) printf "%crw-r--r-- 1 %-8d %-8d %8d %s %s\n" '-' 0 0 `hp48_retsize $INPUT` "`date +\"%b %d %Y %k:%M\"`" "$HP48_CDIR/`hp48_retdir $INPUT`";;
printf "drwxr-xr-x 1 %-8d %-8d %8d %s %s\n" 0 0 `hp48_retsize $INPUT` "$NOW" "$HP48_CDIR/`hp48_retdir $INPUT`";;
file) printf "%crw-r--r-- 1 %-8d %-8d %8d %s %s\n" '-' 0 0 `hp48_retsize $INPUT` "$NOW" "$HP48_CDIR/`hp48_retdir $INPUT`";;
esac
read -r INPUT
done