aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>2019-11-05 01:50:39 -0300
committerMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>2019-12-11 21:21:21 -0300
commit841117da51e8beac2e2048b75b6c30368941ffa3 (patch)
treee8d9769c483278611d974cc639a8823f83a9d03f
parent46ed120fc83ef61d40eca8badb7fa4a0d3d8da3b (diff)
zbarcam: remove LF from raw one shot mode output
Normally, zbarcam will output a line feed after each barcode. In one shot mode, it is not necessary to provide a logical separator for decoded barcode data since only one barcode will be scanned. Raw one shot mode now omits the unnecessary line feed character in addition to the symbology prefix. Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
-rw-r--r--zbarcam/zbarcam.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/zbarcam/zbarcam.c b/zbarcam/zbarcam.c
index da8f8ac..3e8b669 100644
--- a/zbarcam/zbarcam.c
+++ b/zbarcam/zbarcam.c
@@ -130,11 +130,14 @@ static void data_handler (zbar_image_t *img, const void *userdata)
if(fwrite(xml_buf, xml_len, 1, stdout) != 1)
continue;
}
- printf("\n");
n++;
- if(oneshot)
+ if(oneshot) {
+ if (format != RAW)
+ printf("\n");
break;
+ } else
+ printf("\n");
}
if(format == XML && n)

Privacy Policy