From d9fc47453baf3c0caddc8da1661ffbd59f0a4a5c Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 4 Feb 2011 10:56:43 +0300 Subject: [PATCH] Optimization: get rid of triple run of isoinfo -d. Signed-off-by: Andrew Borodin --- lib/vfs/mc-vfs/extfs/iso9660.in | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/vfs/mc-vfs/extfs/iso9660.in b/lib/vfs/mc-vfs/extfs/iso9660.in index 964c4f8a3..c78c829a1 100644 --- a/lib/vfs/mc-vfs/extfs/iso9660.in +++ b/lib/vfs/mc-vfs/extfs/iso9660.in @@ -23,12 +23,14 @@ test_iso () { JOLIET_OPT="-J" fi ISOINFO="isoinfo -R" - isoinfo -d -i "$1" 2>/dev/null | @GREP@ "UCS level 1\|NO Joliet" > /dev/null || ISOINFO="$ISOINFO $JOLIET_OPT" - if [ `isoinfo -d -i "$1" 2>/dev/null | @GREP@ "Joliet with UCS level 3 found" | wc -l` == 1 ] ; then - if [ `isoinfo -d -i "$1" 2>/dev/null | @GREP@ "NO Rock Ridge" | wc -l` == 1 ] ; then - SEMICOLON="YES" - fi + ISOINFO_D_I="`isoinfo -d -i "$1" 2>/dev/null`" + + echo "$ISOINFO_D_I" | @GREP@ "UCS level 1\|NO Joliet" > /dev/null || ISOINFO="$ISOINFO $JOLIET_OPT" + + if [ `echo "$ISOINFO_D_I" | @GREP@ "Joliet with UCS level 3 found" | wc -l` = 1 \ + -a `echo "$ISOINFO_D_I" | @GREP@ "NO Rock Ridge" | wc -l` = 1 ] ; then + SEMICOLON="YES" fi }