lynx-dev
[Top][All Lists]
Advanced

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

LYNX-DEV Converting local names to URL-s


From: Hrvoje Niksic
Subject: LYNX-DEV Converting local names to URL-s
Date: 21 Jan 1997 14:17:26 +0100

When converting local names to URL-s (file://localhost/...) lynx does
not attempt to escape `%' chars in the filenames.  So, if you are in a
directory named `/home/hniksic/%7Eddzeko/', and want to view
`index.html', the command

$ lynx index.html

fails for no apparent reason (lynx prints out "Can't access start file
file://localhost/home/hniksic/%7Eddzeko/index.html"); in fact, lynx
translates the `%7E' to `~' internally and tries to
open("/home/hniksic/~ddzeko/index.html"), which fails.

The following patch should take care of this; pleas consider applying
it for a future version.

*** LYUtils.c.old       Tue Jan 21 13:31:09 1997
--- LYUtils.c   Tue Jan 21 14:09:03 1997
***************
*** 2076,2082 ****
                /*
                 *  It is a subdirectory or file on the local system.
                 */
!               StrAllocCat(*AllocatedString, temp);
                if (TRACE) {
                    fprintf(stderr, "Converted '%s' to '%s'\n",
                                    old_string, *AllocatedString);
--- 2076,2089 ----
                /*
                 *  It is a subdirectory or file on the local system.
                 */
!               char *tmp;
!               tmp = HTEscape(temp, (unsigned char)4);
!               if (TRACE) {
!                   fprintf(stderr, "Converted '%s' to '%s'\n",
!                           temp, tmp);
!               }
!               StrAllocCat(*AllocatedString, tmp);
!               FREE(tmp);
                if (TRACE) {
                    fprintf(stderr, "Converted '%s' to '%s'\n",
                                    old_string, *AllocatedString);
***************
*** 2088,2102 ****
            }
        }
  #endif /* VMS */
!     } else { 
        /*
         *  Path begins with a slash.  Use it as is.
         */
!       StrAllocCat(*AllocatedString, old_string);
        if (TRACE) {
            fprintf(stderr, "Converted '%s' to '%s'\n",
!                           old_string, *AllocatedString);
        }
      }
      if (old_string) {
        FREE(old_string);
--- 2095,2116 ----
            }
        }
  #endif /* VMS */
!     } else {
        /*
         *  Path begins with a slash.  Use it as is.
         */
!       char *tmp;
!       tmp = HTEscape(old_string, (unsigned char)4);
!       if (TRACE) {
!           fprintf(stderr, "Converted '%s' to '%s'\n",
!                   old_string, tmp);
!       }
!       StrAllocCat(*AllocatedString, tmp);
        if (TRACE) {
            fprintf(stderr, "Converted '%s' to '%s'\n",
!                           tmp, *AllocatedString);
        }
+       FREE(tmp);
      }
      if (old_string) {
        FREE(old_string);


P.S.
Please keep me in the Cc:, as I'm not on the list.

-- 
Hrvoje Niksic <address@hidden> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
WWW:          World-Wide-Waste.  Waste management corporation, which
              handles the billions of tons of garbage generated by just
              about everybody these days.
;
; 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]