Ticket #3747: 3747-0002-extfs-hp48-make-the-code-more-readable.patch

File 3747-0002-extfs-hp48-make-the-code-more-readable.patch, 1.8 KB (added by mooffie, 5 years ago)
  • src/vfs/extfs/helpers/hp48+.in

    From e2e1a1ed50ef56baca36d4df3897b57cdfc38493 Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Wed, 28 Dec 2016 17:38:25 +0200
    Subject: [PATCH 2/2] Ticket #3747: extfs: hp48: make the code more readable.
    
    Whitespace tweaking here. There's no change in the code itself except for
    using '%c' in the first printf too, to make it like the second printf.
    ---
     src/vfs/extfs/helpers/hp48+.in | 16 ++++++++++++----
     1 file changed, 12 insertions(+), 4 deletions(-)
    
    diff --git a/src/vfs/extfs/helpers/hp48+.in b/src/vfs/extfs/helpers/hp48+.in
    index 838f565..17c03ab 100644
    a b echo QUIT)| $KERMIT -B >/dev/null 
    6565hp48_parser() 
    6666{ 
    6767HP48_DIRS= 
     68 
    6869read -r INPUT 
    6970while [ "x$INPUT" != "xEOF" ] 
    7071do 
    do 
    7778    obj_size=`echo $obj_size | $AWK '{ print int($0) }'`  # Truncates floats to ints; anything else to "0". 
    7879 
    7980    if [ "$obj_size" != "0" ]; then  # Skips the 1st reply line (purportedly there aren't zero-size files b/c, according to resource [4], the size is "including name"). 
    80     case "$obj_type" in 
    81     Directory) HP48_DIRS="$HP48_DIRS $obj_name" 
    82     printf "drwxr-xr-x   1 %-8d %-8d %8d %s %s\n" 0 0 $obj_size "$NOW" "$HP48_CDIR/$obj_name";; 
    83     *) printf "%crw-r--r--   1 %-8d %-8d %8d %s %s\n" '-' 0 0 $obj_size "$NOW" "$HP48_CDIR/$obj_name";; 
     81      case "$obj_type" in 
     82        Directory) 
     83          HP48_DIRS="$HP48_DIRS $obj_name" 
     84          printf "%crwxr-xr-x   1 %-8d %-8d %8d %s %s\n" 'd' \ 
     85            0 0 $obj_size "$NOW" "$HP48_CDIR/$obj_name" 
     86          ;; 
     87        *) 
     88          printf "%crw-r--r--   1 %-8d %-8d %8d %s %s\n" '-' \ 
     89            0 0 $obj_size "$NOW" "$HP48_CDIR/$obj_name" 
     90          ;; 
    8491    esac 
    8592    fi 
    8693 
    8794    read -r INPUT 
    8895done 
     96 
    8997for HP48_DIR in $HP48_DIRS; 
    9098do  
    9199    HP48_PDIR="$HP48_CDIR"