1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Fix indentation in ftp.c (getftp)

This commit is contained in:
Darshit Shah 2014-12-04 19:08:36 +05:30
parent aaefe8bc83
commit e6713474c0
2 changed files with 65 additions and 62 deletions

View File

@ -1,6 +1,7 @@
2014-12-04 Darshit Shah <darnir@gmail.com> 2014-12-04 Darshit Shah <darnir@gmail.com>
* ftp.c (getftp): Remove a call to assert(1) and replace with error message * ftp.c (getftp): Remove a call to assert(1) and replace with error message
Also fix indentation
2014-12-04 Darshit Shah <darnir@gmail.com> 2014-12-04 Darshit Shah <darnir@gmail.com>

126
src/ftp.c
View File

@ -700,76 +700,78 @@ Error in server response, closing control connection.\n"));
for (cwd_count = cwd_start; cwd_count < cwd_end; cwd_count++) for (cwd_count = cwd_start; cwd_count < cwd_end; cwd_count++)
{ {
switch (cwd_count) switch (cwd_count)
{ {
case 0: case 0:
/* Step one (optional): Go to the initial directory, /* Step one (optional): Go to the initial directory,
exactly as reported by the server. exactly as reported by the server.
*/ */
targ = con->id; targ = con->id;
break; break;
case 1: case 1:
/* Step two: Go to the target directory. (Absolute or /* Step two: Go to the target directory. (Absolute or
relative will work now.) relative will work now.)
*/ */
targ = target; targ = target;
break; break;
case 2: case 2:
/* Step three (optional): "CWD []" to restore server /* Step three (optional): "CWD []" to restore server
VMS-ness. VMS-ness.
*/ */
targ = "[]"; targ = "[]";
break; break;
default: default:
logprintf (LOG_ALWAYS, _("Logically impossible section reached in getftp()")); logprintf (LOG_ALWAYS, _("Logically impossible section reached in getftp()"));
logprintf (LOG_ALWAYS, _("cwd_count: %d\ncwd_start: %d\ncwd_end: %d\n"), logprintf (LOG_ALWAYS, _("cwd_count: %d\ncwd_start: %d\ncwd_end: %d\n"),
cwd_count, cwd_start, cwd_end); cwd_count, cwd_start, cwd_end);
abort (); abort ();
} }
if (!opt.server_response) if (!opt.server_response)
logprintf (LOG_VERBOSE, "==> CWD (%d) %s ... ", cwd_count, logprintf (LOG_VERBOSE, "==> CWD (%d) %s ... ", cwd_count,
quotearg_style (escape_quoting_style, target)); quotearg_style (escape_quoting_style, target));
err = ftp_cwd (csock, targ);
/* FTPRERR, WRITEFAILED, FTPNSFOD */ err = ftp_cwd (csock, targ);
switch (err)
{ /* FTPRERR, WRITEFAILED, FTPNSFOD */
case FTPRERR: switch (err)
logputs (LOG_VERBOSE, "\n"); {
logputs (LOG_NOTQUIET, _("\ case FTPRERR:
logputs (LOG_VERBOSE, "\n");
logputs (LOG_NOTQUIET, _("\
Error in server response, closing control connection.\n")); Error in server response, closing control connection.\n"));
fd_close (csock); fd_close (csock);
con->csock = -1; con->csock = -1;
return err; return err;
case WRITEFAILED: case WRITEFAILED:
logputs (LOG_VERBOSE, "\n"); logputs (LOG_VERBOSE, "\n");
logputs (LOG_NOTQUIET, logputs (LOG_NOTQUIET,
_("Write failed, closing control connection.\n")); _("Write failed, closing control connection.\n"));
fd_close (csock); fd_close (csock);
con->csock = -1; con->csock = -1;
return err; return err;
case FTPNSFOD: case FTPNSFOD:
logputs (LOG_VERBOSE, "\n"); logputs (LOG_VERBOSE, "\n");
logprintf (LOG_NOTQUIET, _("No such directory %s.\n\n"), logprintf (LOG_NOTQUIET, _("No such directory %s.\n\n"),
quote (u->dir)); quote (u->dir));
fd_close (csock); fd_close (csock);
con->csock = -1; con->csock = -1;
return err; return err;
case FTPOK: case FTPOK:
break; break;
default: default:
abort (); abort ();
} }
if (!opt.server_response)
logputs (LOG_VERBOSE, _("done.\n"));
} /* for */ if (!opt.server_response)
logputs (LOG_VERBOSE, _("done.\n"));
} /* for */
/* 2004-09-20 SMS. */ /* 2004-09-20 SMS. */
/* End of deviant indenting. */
} /* else */ } /* else */
} }