diff lib/fsplib/fsplib.c @ 667:6b6fbcf76d00

2005-1-18 Brian Masney <masneyb@gftp.org> * lib/fsplib/fsplib.[ch] - updated files from FSPLIB 0.3
author masneyb
date Wed, 19 Jan 2005 02:05:56 +0000
parents be9663e0be00
children 81172373727f
line wrap: on
line diff
--- a/lib/fsplib/fsplib.c	Wed Jan 19 01:56:48 2005 +0000
+++ b/lib/fsplib/fsplib.c	Wed Jan 19 02:05:56 2005 +0000
@@ -2,7 +2,7 @@
 This file is part of fsplib - FSP protocol stack implemented in C
 language. See http://fsp.sourceforge.net for more information.
 
-Copyright (c) 2003-2004 by Radim HSN Kolar (hsn@netmag.cz)
+Copyright (c) 2003-2005 by Radim HSN Kolar (hsn@netmag.cz)
 
 You may copy or modify this file in any manner you wish, provided
 that this notice is always included, and that you hold the author
@@ -251,6 +251,7 @@
     /* compute initial delay here */
     /* we are using hardcoded value for now */
     f_delay = 1340;
+    l_delay = 0;
     for(;;retry++)
     {
 	if(t_delay >= s->timeout)
@@ -578,6 +579,7 @@
 {
     FSP_RDENTRY fentry,*fresult;
     int rc;
+    char *c;
 
     if (dir == NULL || entry == NULL || *result == NULL)
         return -EINVAL;
@@ -595,6 +597,17 @@
 	entry->d_type=DT_DIR;
     else
 	entry->d_type=DT_REG;
+	
+    /* remove symlink destination */
+    c=strchr(fentry.name,'\n');
+    if (c)
+    {
+	*c='\0';
+	rc=fentry.namlen-strlen(fentry.name);
+	fentry.reclen-=rc;
+	fentry.namlen-=rc;
+    }
+
     entry->d_fileno = 10;
     entry->d_reclen = fentry.reclen;
     strncpy(entry->d_name,fentry.name,MAXNAMLEN);
@@ -602,7 +615,7 @@
     if (fentry.namlen > MAXNAMLEN)
     {
 	entry->d_name[MAXNAMLEN + 1 ] = '\0';
-#ifdef HAVE_NAMLEN	
+#ifdef HAVE_NAMLEN
 	entry->d_namlen = MAXNAMLEN;
     } else
     {