Commit 08238f43 authored by Sterling Hughes's avatar Sterling Hughes
Browse files

Fix formatting when tabs and spaces got mixed up (if tabstop was not set to

8 this looked quite funny :)

Added a small formatting section for vim at the bottom, it also contains an
emacs portion (copied it from another project I'm working on), I don't know
if this is correct, but its a step (the vim part is correct :)
parent 06993556
Loading
Loading
Loading
Loading
+145 −125
Original line number Diff line number Diff line
@@ -933,12 +933,14 @@ CURLcode _ftp(struct connectdata *conn)
        if (getnameinfo((struct sockaddr *)&ss, sslen,
                         portmsgbuf, sizeof(portmsgbuf), tmp, sizeof(tmp), niflags))
          continue;

        /* do not transmit IPv6 scope identifier to the wire */
      	if (sa->sa_family == AF_INET6) {
          char *q = strchr(portmsgbuf, '%');
          if (q)
            *q = '\0';
        }

        ftpsendf(conn->firstsocket, conn, "%s |%d|%s|%s|", *modep, eprtaf,
                 portmsgbuf, tmp);
      } else if (strcmp(*modep, "LPRT") == 0 ||
@@ -957,26 +959,33 @@ CURLcode _ftp(struct connectdata *conn)
            continue;
          }
        }

        for (i = 0; i < alen; i++) {
          if (portmsgbuf[0])
            snprintf(tmp, sizeof(tmp), ",%u", ap[i]);
          else
            snprintf(tmp, sizeof(tmp), "%u", ap[i]);

          if (strlcat(portmsgbuf, tmp, sizeof(portmsgbuf)) >= sizeof(portmsgbuf)) {
            continue;
          }
        }

        if (strcmp(*modep, "LPRT") == 0) {
          snprintf(tmp, sizeof(tmp), ",%d", plen);

          if (strlcat(portmsgbuf, tmp, sizeof(portmsgbuf)) >= sizeof(portmsgbuf))
            continue;
        }

        for (i = 0; i < plen; i++) {
          snprintf(tmp, sizeof(tmp), ",%u", pp[i]);

          if (strlcat(portmsgbuf, tmp, sizeof(portmsgbuf)) >= sizeof(portmsgbuf)) {
              continue;
          }
        }

        ftpsendf(conn->firstsocket, conn, "%s %s", *modep, portmsgbuf);
      }

@@ -1165,6 +1174,7 @@ CURLcode _ftp(struct connectdata *conn)
    	    break;
        str++;
      }

      if(!*str) {
        failf(data, "Couldn't interpret this 227-reply: %s", buf);
        return CURLE_FTP_WEIRD_227_FORMAT;
@@ -1228,6 +1238,7 @@ CURLcode _ftp(struct connectdata *conn)
            snprintf(nbuf, sizeof(nbuf), "?");
            snprintf(sbuf, sizeof(sbuf), "?");
          }
        
          if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf),
                          NULL, 0, 0)) {
            infof(data, "Connecting to %s port %s\n", nbuf, sbuf);
@@ -1817,3 +1828,12 @@ CURLcode Curl_ftp_disconnect(struct connectdata *conn)
  }
  return CURLE_OK;
}

/*
 * Local variables:
 * tab-width: 2
 * c-basic-offset: 2
 * End:
 * vim600: et sw=2 ts=2 sts=2 tw=78 fdm=marker
 * vim<600: et sw=2 ts=2 sts=2 tw=78
 */