}
dir = l = NULL;
- /* Empty line */
- read_whole_line (fp);
- /* "Directory PUB$DEVICE[PUB]" */
- read_whole_line (fp);
- /* Empty line */
- read_whole_line (fp);
+ /* Skip empty line. */
+ line = read_whole_line (fp);
+ if (line)
+ xfree (line);
+
+ /* Skip "Directory PUB$DEVICE[PUB]" */
+ line = read_whole_line (fp);
+ if (line)
+ xfree (line);
+
+ /* Skip empty line. */
+ line = read_whole_line (fp);
+ if (line)
+ xfree (line);
/* Line loop to end of file: */
while ((line = read_whole_line (fp)))
{
char *p;
i = clean_line (line);
- if (!i) break;
+ if (!i)
+ {
+ xfree (line);
+ break;
+ }
/* First column: Name. A bit of black magic again. The name my be
either ABCD.EXT or ABCD.EXT;NUM and it might be on a separate
if (!i)
{
DEBUGP(("confusing VMS listing item, leaving listing parser\n"));
+ xfree (line);
break;
}
tok = strtok(line, " ");
the first strtok(NULL, "-") will return everything until the end
of the line and only the next strtok() call will return NULL. */
DEBUGP(("nonsense in VMS listing, skipping this line\n"));
+ xfree (line);
break;
}
for (i=0; i<12; i++) if (!strcmp(tok,months[i])) break;
if (tok == NULL)
{
DEBUGP(("confusing VMS permissions, skipping line\n"));
+ xfree (line);
continue;
}
/* Permissons have the format "RWED,RWED,RE" */
return ftp_parse_unix_ls (file, TRUE);
default:
logprintf (LOG_NOTQUIET, _("\
-Usupported listing type, trying Unix listing parser.\n"));
+Unsupported listing type, trying Unix listing parser.\n"));
return ftp_parse_unix_ls (file, FALSE);
}
}
directories and files on the appropriate host. The references are
FTP. */
uerr_t
-ftp_index (const char *file, struct urlinfo *u, struct fileinfo *f)
+ftp_index (const char *file, struct url *u, struct fileinfo *f)
{
FILE *fp;
char *upwd;