Re: [patch] bashism in sh script

2003-08-14 Thread Pavel Roskin
On Fri, 1 Aug 2003, GoTaR wrote:

 There's no thing like $[..] to evaluate expressions in POSIX sh, it's
 bash feature. sh uses $((..)) instead (and bash understands it too).
 Here comes fix.

Does the next line work for you?  I mean this:

if (( $A  10 )); then A=0$A; fi

I think it's a much worse case of non-portable code.  Have you tested your
changes?

-- 
Regards,
Pavel Roskin

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel


suggestion: batchmode feature for MC

2003-08-14 Thread Alex Schütz
Dear Developers,

Your Midnight Commander is a great tool. However, I frequently use it to 
copy files from directories where I don't have proper access rights for 
some of the files in the dir, especially over an FTP connection.
I'd really appreciate if MC had a sort of batch mode, that is, as soon as 
a red warningscreen is about to pop up, it ought to always select option 
1 from the warningscreen options with no user intervention necessary.
Can you do that? If so, please let me know,

Yours
Alex
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: [patch] bashism in sh script

2003-08-14 Thread Pavel Roskin
On Fri, 8 Aug 2003, Andrew V. Samoilov wrote:

 I think patch below make audio.in much more portable.

Applied.

 BTW, I don't see reason to substitute audio from audio.in.

There is @AWK@ in audiofs_copyout(), but it's hard to notice :-)

-- 
Regards,
Pavel Roskin
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: [patch] bashism in sh script

2003-08-14 Thread Andrew V. Samoilov
 On Fri, 1 Aug 2003, GoTaR wrote:
 
  There's no thing like $[..] to evaluate expressions in POSIX sh, it's
  bash feature. sh uses $((..)) instead (and bash understands it too).
  Here comes fix.
 
 Does the next line work for you?  I mean this:
 
 if (( $A  10 )); then A=0$A; fi
 
 I think it's a much worse case of non-portable code.  Have you tested your
 changes?

I think patch below make audio.in much more portable.
BTW, I don't see reason to substitute audio from audio.in.

-- 
Regards,
Andrew V. Samoilov.
--- audio.in~   Fri Dec 13 06:42:10 2002
+++ audio.inFri Aug  8 10:54:31 2003
@@ -15,13 +15,12 @@
 audiofs_list ()
 {
 echo -r--r--r-- 1 0 0 0 Jan 1 0:00 CDDB
-cdparanoia -Q -d $1 21 | grep '^[ 0-9][ 0-9][ 0-9]\.' | while true
+cdparanoia -Q -d $1 21 | grep '^[ 0-9][ 0-9][ 0-9]\.' | while read A B C
 do
-read A B C || break
-A=`echo $A | sed 's/\.//'`
-SIZE=$[44+$B*2352]
-if (( $A  10 )); then A=0$A; fi
-echo -r--r--r-- 1 0 0 $SIZE Jan 1 0:00 track-${A}.wav
+   A=`echo $A | sed 's/\.//'`
+   SIZE=`expr 44 + $B \* 2352`
+   if test $A -lt 10 ; then A=0$A; fi
+   echo -r--r--r-- 1 0 0 $SIZE Jan 1 0:00 track-${A}.wav
 done
 }
 
@@ -41,7 +40,7 @@
 }
 
 if [ ! -b $2 ]
-then
+then
 BASE=/dev/cdrom
 else
 BASE=$2


[patch] uzip extfs 9999999 bytes fix

2003-08-14 Thread Oskar Liljeblad
Here's a small patch that fixes a silly bug that would prevent
uzip from listing files that are larger than 999 bytes...

The only change is the '+' character (into '*').

Oskar

--- uzip.orig   2003-08-05 17:21:00.0 +0200
+++ uzip2003-08-05 17:21:13.0 +0200
@@ -202,7 +202,7 @@
} else {
while (PIPE) {
chomp;
-   my @match = /^ +(\d+) +([^ ]+) +(\d+) +(\d+\%) 
+(\d?\d)-(\d?\d)-(\d\d) (\d?\d):(\d\d) +([0-9a-f]+) +(.*)$/;
+   my @match = /^ *(\d+) +([^ ]+) +(\d+) +(\d+\%) 
+(\d?\d)-(\d?\d)-(\d\d) (\d?\d):(\d\d) +([0-9a-f]+) +(.*)$/;
next if ($#match != 10);
my @rmatch = ('', '', 'unknown', $match[0], '', $match[2], 
$match[1],
$match[6] + ($match[6]  70 ? 2000 : 1900), 
$match[4], $match[5],
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel