On Fri, Jun 27, 2003 at 11:43:10PM +0200, Dragan Cvetkovic wrote:
> I am using lftp 2.6.5 on Solaris machines and I have noticed that when
> doing mirror command, if one of the file names is -1, the mirror process
> would stop.
Here is a patch to fix the problem.
--
Alexander.
Index: Fish.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/Fish.cc,v
retrieving revision 1.53
diff -u -p -r1.53 Fish.cc
--- Fish.cc 14 Oct 2004 12:02:35 -0000 1.53
+++ Fish.cc 14 Oct 2004 14:38:44 -0000
@@ -443,9 +443,16 @@ const char *Fish::shell_encode(const cha
char *r;
const char *s;
- result = (char*)xrealloc (result, 2 * strlen (string) + 1);
+ result = (char*)xrealloc (result, 2 + 2 * strlen (string) + 1);
- for (r = result, s = string; s && (c = *s); s++)
+ r = result;
+ if(string[0]=='-' || string[0]=='~')
+ {
+ *r++='.';
+ *r++='/';
+ }
+
+ for (s = string; s && (c = *s); s++)
{
switch (c)
{
@@ -459,14 +466,10 @@ const char *Fish::shell_encode(const cha
case '"': case '\\': /* quoting chars */
case '|': case '&': case ';': /* shell metacharacters */
case '<': case '>':
+ case '#': /* comment char */
*r++ = '\\';
*r++ = c;
break;
- case '~': /* tilde expansion */
- case '#': /* comment char */
- if (s == string)
- *r++ = '\\';
- /* FALLTHROUGH */
default:
*r++ = c;
break;