lynx-dev
[Top][All Lists]
Advanced

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

[Lynx-dev] Lynx and filenames with square brackets.


From: Gaute Strokkenes
Subject: [Lynx-dev] Lynx and filenames with square brackets.
Date: Fri, 24 Jul 2009 14:57:24 +0100
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.3 (gnu/linux)

Currently, change_sug_filename in LYUtils.c contains the following
snippet:

    /*
     * Trim off VMS device and/or directory specs, if present.
     */
    if ((cp = strchr(fname, '[')) != NULL &&
        (cp1 = strrchr(cp, ']')) != NULL && strlen(cp1) > 1) {
        cp1++;
        for (cp = fname; *cp1 != '\0'; cp1++) {
            *(cp++) = *cp1;
        }
        *cp = '\0';
    }

Note that in spite of the reference to VMS, this is protected by #ifdef
VMS or anything similar.  The effect is that if you download a file that
contains the characters [ and ] (in that order), everything from the
beginning up to and including the last ] is deleted from the filename
that Lynx suggests when you use "d" to download it.  (Well, as long as
there's a least one character after the ].)

This is unfortunate, as in certain contexts it's common practise to
include CRC32 checksums in filenames, usually in this style:
"Filename_[DEADBEEF].avi".

I'm unsure what problem the original code is intended to solve, and
whether it's relevant on non-VMS platforms.  For me, simply commenting
out the block solves the entire problem.

-- 
Gaute Strokkenes




reply via email to

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