delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/07/08:43:56

Date: Tue, 7 Jan 1997 15:29:09 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Mark Lewis <nostra AT city DOT ac DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: BUG: Possible bug in DJGPP "ls" port
In-Reply-To: <5arpl1$ju7@bambam.soi.city.ac.uk>
Message-ID: <Pine.SUN.3.91.970107152556.27480A-100000@is>
MIME-Version: 1.0

On 6 Jan 1997, Mark Lewis wrote:

> I have a directory 'f:\x' which contains a few files (including, for example
> 'file.zip').  If I am in 'f:\' and I do `ls x` everything works fine.  If I
> try `ls -p`, or any of the other switches I've tried off-hand, it throws up
> all sorts of errors about 'ls: xfile.zip: No such file or directory

This is indeed a bug in the DJGPP port of `ls', thanks for reporting it.  
Patched versions of `ls.exe', `dir.exe' and `vdir.exe' are available from 
ftp://is.elta.co.il/pub/.  A source-level patch (for those who have the 
Fileutils source distribution v2gnu/fil313s.zip) is below:

*** src/ls.c~0	Mon Sep 30 10:36:32 1996
--- src/ls.c	Tue Jan  7 09:52:10 1997
*************** attach (char *dest, const char *dirname,
*** 2793,2800 ****
  	*dest++ = *dirnamep++;
  #ifdef  MSDOS
        /* "d:" does NOT mean "d:/"  */
!       if (dirnamep > dirname + 1
! 	  && (dirname[1] != ':' || dirname[2] != '\0'))
  #endif
        /* Add '/' if `dirname' doesn't already end with it. */
        if (dirnamep > dirname && dirnamep[-1] != '/')
--- 2793,2800 ----
  	*dest++ = *dirnamep++;
  #ifdef  MSDOS
        /* "d:" does NOT mean "d:/"  */
!       if (dirnamep <= dirname + 1
! 	  || dirname[1] != ':' || dirname[2] != '\0')
  #endif
        /* Add '/' if `dirname' doesn't already end with it. */
        if (dirnamep > dirname && dirnamep[-1] != '/')

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019