Re: mtools extfs script patch proposal



Hello!

> > I've recently played with the mc and mtools. The extfs for mtools a needs 
> > the patch below to run properly with the current mtools packages. With 
> > this patch the compatibility issues do not exist.

I agree.  The default format is dd-mm-yyyy, according to the info page for 
mtools 3.9.8.

> ENV_VAR=value command syntax is specific to bash. It's better to set
> this variable in the ENV hash.

I agree.  When using Perl, use Perl.  By the way, 
MTOOLS_TWENTY_FOUR_HOUR_CLOCK should also be set to be on the safe side.

While testing this change, I have discovered one more problem - long 
filenames with spaces were truncated.  I have fixed this bug as well.

I'm committing this patch:
====================================
--- vfs/extfs/a
+++ vfs/extfs/a
@@ -17,6 +17,9 @@
 $0 =~ s|.*/||;
 $disk = $0;
 
+$ENV{MTOOLS_DATE_STRING} = "mm-dd-yyyy";
+$ENV{MTOOLS_TWENTY_FOUR_HOUR_CLOCK} = "1";
+
 SWITCH: for ( $ARGV[0] ) {
   /list/ && do {
     @dirs = get_dirs("");
@@ -75,7 +78,7 @@
     $_ = substr($_,12);
     s/^[ ]+//;
 
-    ($size,$date,$time,$longname) = split(/[ \t]+/);
+    ($size,$date,$time,$longname) = split(/[ \t]+/, $_, 4);
 
     @lst = split(/([:ap])/, $time);
     $lst[0] += 12 if ($lst[3] eq "p");
====================================

-- 
Regards,
Pavel Roskin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]