delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/11/10:45:47

From: "A. Sinan Unur" <sinan DOT unur AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bug in DJGPP?
Date: Sun, 11 Jan 1998 10:29:32 -0500
Organization: Cornell University (http://www.cornell.edu/)
Lines: 69
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <34B8E55C.98241C17@cornell.edu>
References: <34b83a96 DOT 0 AT kastagir DOT senet DOT com DOT au>
NNTP-Posting-Host: cu-dialup-0047.cit.cornell.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Richard Sim wrote:
> 
> Hi everyone, I dunno if this is a bug, a 'feature' or my botchyness...
> When you have a program that takes command line args, and since DJGPP
> automatically expands wildcards, if your running in Win95, and have 
> some files with long filenames that match the wildcards, DJGPP always 
> gives you the long file name, not the short one, even when LFN's are 
> disabled, so if you call something like fopen with the command line 
> argument, the file can't be found.

this indeed seems like a bug. with lfn disabled in djgpp.env (+lfn=n),
the following program:

#include <stdio.h>

int main(int argc, char *argv[])
{
 int i;
 for(i=0; i<argc; i++)
  puts(argv[i]);

 return;
}
produced:
D:\djgpp\C\TEST> testlfn *.c
d:/djgpp/c/test/testlfn.exe
bernoulli.c
simpldtst.c
simplw.c
testlfn.c
tt.c

then i did (with lfn still disabled in djgpp.env)
D:\djgpp\C\TEST> set lfn=n

D:\djgpp\C\TEST> testlfn *.c
d:/djgpp/c/test/testlfn.exe
bernou~1.c
simpld~1.c
simplw.c
testlfn.c
tt.c

incidentally, with set lfn=n, +lfn=y, you still get the short names.

it seems like a bug in the startup code.

(by the way, if i run the following code with +lfn=n set in djgpp.env
but not in the environment, i do get lfn=n output:

#include <stdio.h>
int main(int argc, char *argv[], char* envp[])
{
 int i;
 for(i=0; envp[i] != NULL; i++)
  puts(envp[i]);
 for(i=0; i<argc; i++)
  puts(argv[i]);
 return;
}
)
-- 
----------------------------------------------------------------------
A. Sinan Unur
Department of Policy Analysis and Management, College of Human Ecology,
Cornell University, Ithaca, NY 14853, USA

mailto:sinan DOT unur AT cornell DOT edu
http://www.people.cornell.edu/pages/asu1/

- Raw text -


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