lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev Improper ~/ expansion in file:// - new mini-patch


From: Klaus Weide
Subject: Re: lynx-dev Improper ~/ expansion in file:// - new mini-patch
Date: Sat, 2 Jan 1999 16:50:36 -0600 (CST)

On Sun, 13 Dec 1998, Ryan Hung wrote:

> > --- lynx2-8-1-orig/src/LYGetFile.c  Wed Oct 14 07:23:56 1998
> > +++ lynx2-8-1/src/LYGetFile.c       Sun Nov 22 16:24:13 1998
> > @@ -605,8 +605,10 @@
> >                         *cp1 = '\0';
> >                         cp1 += 2;
> >                         StrAllocCopy(temp, doc->address);
> > -                       LYAddHtmlSep(&temp);
> > -                       StrAllocCat(temp, wwwName(Home_Dir()));
> > +                       StrAllocCopy(cp, wwwName(Home_Dir()));
> > +                       if (!LYIsHtmlSep(cp))
> > +                           LYAddHtmlSep(&temp);
> > +                       StrAllocCat(temp, cp);
> >                         if ((cp2 = strchr(cp1, '/')) != NULL) {
> >                             LYTrimRelFromAbsPath(cp2);
> >                             StrAllocCat(temp, cp2);
> 
> Ok, I finally figured out your code here, Klaus.  As I mentioned, it
> doesn't work directly, but if one just completely removes the line
> "LYAddHtmlSep(&temp);" in the original code (any version from 2.8.1.rel.2
> to 2.8.2.dev.8), it completely fixes the problem with the prepended "//"
> in the "/~" expansion.  Of course, I don't know whether this also produces
> any more problems...

And I finally figured out what was wrong with the above, it should have
been LYIsHtmlSep(*cp) instead of LYIsHtmlSep(cp).  With that change,
it works for me.

Effectively this is the same as removing the LYAddHtmlSep(&temp) for Unix.
It is just a bit more general.

Here is the corrected patch.  It should probably also go into
the Lynx2-8-1 bug fixes.


*** lynx2-8-2.orig/src/LYGetFile.c      Thu Dec 24 05:27:23 1998
--- lynx2-8-2/src/LYGetFile.c   Sat Jan  2 16:45:21 1999
***************
*** 603,610 ****
                            *cp1 = '\0';
                            cp1 += 2;
                            StrAllocCopy(temp, doc->address);
!                           LYAddHtmlSep(&temp);
!                           StrAllocCat(temp, wwwName(Home_Dir()));
                            if ((cp2 = strchr(cp1, '/')) != NULL) {
                                LYTrimRelFromAbsPath(cp2);
                                StrAllocCat(temp, cp2);
--- 603,612 ----
                            *cp1 = '\0';
                            cp1 += 2;
                            StrAllocCopy(temp, doc->address);
!                           StrAllocCopy(cp, wwwName(Home_Dir()));
!                           if (!LYIsHtmlSep(*cp))
!                               LYAddHtmlSep(&temp);
!                           StrAllocCat(temp, cp);
                            if ((cp2 = strchr(cp1, '/')) != NULL) {
                                LYTrimRelFromAbsPath(cp2);
                                StrAllocCat(temp, cp2);



reply via email to

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