diff options
Diffstat (limited to 'system/epson-inkjet-printer-escpr2/fixrm')
-rw-r--r-- | system/epson-inkjet-printer-escpr2/fixrm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/system/epson-inkjet-printer-escpr2/fixrm b/system/epson-inkjet-printer-escpr2/fixrm index ffc0942dd7..e1c5c21315 100644 --- a/system/epson-inkjet-printer-escpr2/fixrm +++ b/system/epson-inkjet-printer-escpr2/fixrm @@ -20,10 +20,11 @@ if [ -e $FNAME ]&&[ `cat $FNAME|head -n1|awk '{print length($0)}'` -gt $MAXLEN ] cat $TMPFILE|awk -v mlen="$MAXLEN" -F', ' 'BEGIN{curline="";mlen=mlen-2} { for (i=1;i<=NF; i++) { { n=0; l=length(curline)+length($i) } - if (l<mlen) { curline=curline ", " $i; n=1} + if (i==1) {curline=$i; n=1} + if (l<mlen && i>1) { curline=curline ", " $i; n=1} if (n==0) {print curline; curline=$i } } - if (length(curline)>0) {print curline} + if (length(curline)>0) {print curline; curline=""} }'>README.models rm $TMPFILE fi |