aboutsummaryrefslogblamecommitdiffstats
path: root/main/hylafaxplus/common-functions-busybox-awk.patch
blob: b217b20b7f8ea97bbeb1aea32f785196aa15233c (plain) (tree)





















                                                                                                                     


















                                                                                                  
 
diff --git a/util/common-functions.sh.in b/util/common-functions.sh.in
index 38049e3..54cfd6b 100644
--- a/util/common-functions.sh.in
+++ b/util/common-functions.sh.in
@@ -40,7 +40,7 @@ setInfoSize()
 		DICTTIMETORECV DICTSIGNALRATE DICTDATAFORMAT DICTERRCORRECT \
 		DICTCALLID1 DICTCALLID2 DICTCALLID3 DICTCALLID4 DICTCALLID \
 		DICTCALLID6 DICTCALLID7 DICTRECEIVEDON DICTCOMMID; do
-	THISLEN="`eval echo \\\""$"$ITEM\\\" | $AWK 'BEGIN {L=0} length>L {L=length} END {print L}' | $SED 's/ //g'`"
+	THISLEN=`eval 'echo ${#'$ITEM'}'`
 	if [ $THISLEN -gt $INFOSIZE ]; then INFOSIZE=$THISLEN; fi
     done
 }
@@ -57,7 +57,7 @@ setItemSize()
 		DICTCALLS DICTPAGES DICTATTEMPTS DICTDIRNUM DICTRECEIVER DICTQUALITY \
 		DICTPAGEWIDTH DICTPAGELENGTH DICTDATAFORMAT DICTREMOTEEQUIPMENT \
 		DICTREMOTESTATION DICTSIGNALRATE; do
-	THISLEN="`eval echo \\\""$"$ITEM\\\" | $AWK 'BEGIN {L=0} length>L {L=length} END {print L}' | $SED 's/ //g'`"
+	THISLEN=`eval 'echo ${#'$ITEM'}'`
 	if [ $THISLEN -gt $ITEMSIZE ]; then ITEMSIZE=$THISLEN; fi
     done
 }
@@ -146,12 +146,12 @@
               } p("faxstatus", status);
               next;
             }
-    /^[!]*post/    { p("files_"++nfiles, $4); p("filetype_"nfiles, "PostScript"); next; }
-    /^[!]*tiff/    { p("files_"++nfiles, $4); p("filetype_"nfiles, "TIFF"); next; }
-    /^[!]*pdf/    { p("files_"++nfiles, $4); p("filetype_"nfiles, "PDF"); next; }
-    /^[!]*pcl/    { p("files_"++nfiles, $4); p("filetype_"nfiles, "PCL"); next; }
-    /^page:/    { p("pins_"++npins, $4); next; }
-    /^data:/    { p("files_"++nfiles, $4); next; }
+    /^[!]*post/    { ++nfiles; p("files_"nfiles, $4); p("filetype_"nfiles, "PostScript"); next; }
+    /^[!]*tiff/    { ++nfiles; p("files_"nfiles, $4); p("filetype_"nfiles, "TIFF"); next; }
+    /^[!]*pdf/    { ++nfiles; p("files_"nfiles, $4); p("filetype_"nfiles, "PDF"); next; }
+    /^[!]*pcl/    { ++nfiles; p("files_"nfiles, $4); p("filetype_"nfiles, "PCL"); next; }
+    /^page:/    { ++npins; p("pins_"npins, $4); next; }
+    /^data:/    { ++nfiles; p("files_"nfiles, $4); next; }
     /^poll/        { p("poll", " -p"); next; }
     # Only parse remaining valid lines and allows for colons to appear in the value part
     /^[a-z]+:/     { str = $0; sub($1":", "", str); p($1, str); next; }