bug-fileutils
[Top][All Lists]
Advanced

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

Re: [fileutils-4.0.43 - ls] 'ls a b' when a doesn't exist and isdir(b)


From: Jim Meyering
Subject: Re: [fileutils-4.0.43 - ls] 'ls a b' when a doesn't exist and isdir(b)
Date: 21 Apr 2001 12:03:47 +0200
User-agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.0.103

Thanks a lot for the report and patch.
I like this one :-)
and have applied it and added a test case based on your example.

Because of this, there will be at least one more test release
before fileutils-4.1.0.

  ftp://alpha.gnu.org/gnu/fetish/

Stephane CHAZELAS <address@hidden> wrote:
| On Thu, Apr 19, 2001 at 08:50:04PM +0200, I wrote:
| > On Wed, Apr 18, 2001 at 10:18:55PM +0200, I wrote:
| > > Here is a simple patch that should fix it:
| > [buggy patch]
| >
| > Oops, this one should be better, sorry:
| [other buggy patch]
|
| Ok, I guess you'll find out the right way to fix this.
| My previous patch failed with ls -R dir
|
| I hope this one is better:
|
| --- ls.c~       Wed Apr 18 21:27:52 2001
| +++ ls.c        Fri Apr 20 19:22:27 2001
| @@ -854,6 +854,7 @@
|  {
|    register int i;
|    register struct pending *thispend;
| +  int nfiles_requested;
|  
|    program_name = argv[0];
|    setlocale (LC_ALL, "");
| @@ -901,7 +902,8 @@
|  
|    clear_files ();
|  
| -  if (i < argc)
| +  nfiles_requested=argc - i;
| +  if (nfiles_requested >= 0)
|      dir_defaulted = 0;
|    for (; i < argc; i++)
|      {
| @@ -929,7 +931,7 @@
|        if (pending_dirs)
|         DIRED_PUTCHAR ('\n');
|      }
| -  else if (pending_dirs && pending_dirs->next == 0)
| +  else if (nfiles_requested <= 1 && pending_dirs && pending_dirs->next == 0)
|      print_dir_name = 0;
|  
|    while (pending_dirs)
| 
| 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]