lynx-dev
[Top][All Lists]
Advanced

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

Re: LYNX-DEV problem moving files across directories using `../'


From: Klaus Weide
Subject: Re: LYNX-DEV problem moving files across directories using `../'
Date: Tue, 10 Dec 1996 04:45:19 -0600 (CST)

On Sun, 8 Dec 1996, Nelson Henry Eric wrote:

> The nicer DIRED gets, the more I use it, but then the more problems
> seem to show up.  I was trying to move a file `boutcgi' while in
> the directory `$HOME/.lynx/Folder/CGI' to a directory parallel to
> the directory above the current directory, namely `$HOME/.lynx/Books'.
> I would have expected `../../Books/' to be acceptable as the `new
> location for file'.  However I got the warning: `Illegal filename;
>  request ignored.'  Entering the full path, `~/.lynx/Books/'
> worked okay.  

Entering of filenames which start with "../" is currently explicitly
blocked in the dired code.  I am not sure what protection is achieved
by that since you can still enter the same path by fully spelling it out
(or sometimes, as in your case, using the ~/ abbreviation).  I am
reluctant to remove that restriction, since it was presumably put there
by someone for some reason...

But if you want to experiment for yourself (and then tell us whether
it breaks anything else), you can locate the function which starts with
 
PRIVATE char *filename ARGS3(
        char *,         prompt,
        char *,         buf,
        int,            bufsize)

in LYLocal.c and remove or comment out the following lines from it:

   if(strstr(buf,"../") != NULL) {
       _statusline("Illegal filename; request ignored.");
       sleep(AlertSecs);
       return NULL;
   }

One problem is that filenames without a full path are interpreted
in different ways, depending on where they are used.  More specifically,
"current directory" doesn't always have the same meaning... In most
places, "current directory" means the directory which was the shell's
current directory when Lynx was started.  (And there is no way to change
this "current directory" during the lifetime of a Lynx process, like
a `lcd' command.)  Some of the special dired functions use the "current
directory in the DIRED sense", i.e. the directory whose listing is
currently displayed.  But for example entering a name starting with 
"." or ".." after g)oto still is relative to the "current directory"
in the general, non-DIRED sense even when you do it while a directory 
listing is displayed.  This can be confusing, and maybe entering such
names ought to be discouraged for this reason..

> No big deal, but it's not strictly un*x-like.  __Henry

Did anybody promise that? :)

  Klaus

;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

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