[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LYNX-DEV patch for djgpp downloaders
From: |
Klaus Peter Wegge |
Subject: |
LYNX-DEV patch for djgpp downloaders |
Date: |
Fri, 6 Feb 1998 17:03:44 +0100 (MET) |
when defining a specific downloader in lynx.cfg, the transferred path
parameters are qouted. There handling in DOS batch files
is not very easy.
Therefore I made a small patch to lyutils.c (AC111) method
quote_pathname, which solves this problem in general.
I know, a better style is to patch all 8 calls of the method,
but this was the easiest way. If you like this patch and it will go to
the dev sources, I.ll do the better patch.
Klaus-Peter
*** lyutils.ori Fri Feb 6 16:11:48 1998
--- lyutils.c Fri Feb 6 16:25:28 1998
***************
*** 2811,2818 ****
PUBLIC char * quote_pathname ARGS1(
char *, pathname)
{
- size_t i, n = 0;
char * result;
for (i=0; i < strlen(pathname); ++i)
if (pathname[i] == '\'') ++n;
--- 2811,2824 ----
PUBLIC char * quote_pathname ARGS1(
char *, pathname)
{
char * result;
+ #ifdef DOSPATH
+ result = (char *)malloc(strlen(pathname) + 1);
+ if (result == NULL)
+ outofmem(__FILE__, "quote_pathname");
+ strcpy(result, pathname);
+ #else
+ size_t i, n = 0;
for (i=0; i < strlen(pathname); ++i)
if (pathname[i] == '\'') ++n;
***************
*** 2834,2839 ****
--- 2840,2846 ----
}
result[n++] = '\'';
result[n] = '\0';
+ #endif
return result;
}
==============================