Deleted Added
full compact
cmds.c (78527) cmds.c (90926)
1/*
2 * Copyright (c) 1985, 1989, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31 * SUCH DAMAGE.
32 */
33
34/*
35 * FTP User Program -- Command Routines.
36 */
37
38#include "ftp_locl.h"
1/*
2 * Copyright (c) 1985, 1989, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31 * SUCH DAMAGE.
32 */
33
34/*
35 * FTP User Program -- Command Routines.
36 */
37
38#include "ftp_locl.h"
39RCSID("$Id: cmds.c,v 1.42 2001/02/15 04:17:09 assar Exp $");
39RCSID("$Id: cmds.c,v 1.44 2001/08/05 06:39:14 assar Exp $");
40
41typedef void (*sighand)(int);
42
43jmp_buf jabort;
44char *mname;
45char *home = "/";
46
47/*

--- 89 unchanged lines hidden (view full) ---

137 mode = MODE_S;
138 strlcpy(structname, "file", sizeof(structname));
139 stru = STRU_F;
140 strlcpy(bytename, "8", sizeof(bytename));
141 bytesize = 8;
142 if (autologin)
143 login(argv[1]);
144
40
41typedef void (*sighand)(int);
42
43jmp_buf jabort;
44char *mname;
45char *home = "/";
46
47/*

--- 89 unchanged lines hidden (view full) ---

137 mode = MODE_S;
138 strlcpy(structname, "file", sizeof(structname));
139 stru = STRU_F;
140 strlcpy(bytename, "8", sizeof(bytename));
141 bytesize = 8;
142 if (autologin)
143 login(argv[1]);
144
145#if (defined(unix) || defined(__unix__) || defined(__unix) || defined(_AIX) || defined(_CRAY)) && NBBY == 8
145#if (defined(unix) || defined(__unix__) || defined(__unix) || defined(_AIX) || defined(_CRAY) || defined(__NetBSD__)) && NBBY == 8
146/*
147 * this ifdef is to keep someone form "porting" this to an incompatible
148 * system and not checking this out. This way they have to think about it.
149 */
150 overbose = verbose;
151 if (debug == 0)
152 verbose = -1;
153 if (command("SYST") == COMPLETE && overbose) {

--- 309 unchanged lines hidden (view full) ---

463 while ((cp = remglob(argv,0)) != NULL) {
464 if (*cp == 0) {
465 mflag = 0;
466 continue;
467 }
468 if (mflag && confirm(argv[0], cp)) {
469 tp = cp;
470 if (mcase) {
146/*
147 * this ifdef is to keep someone form "porting" this to an incompatible
148 * system and not checking this out. This way they have to think about it.
149 */
150 overbose = verbose;
151 if (debug == 0)
152 verbose = -1;
153 if (command("SYST") == COMPLETE && overbose) {

--- 309 unchanged lines hidden (view full) ---

463 while ((cp = remglob(argv,0)) != NULL) {
464 if (*cp == 0) {
465 mflag = 0;
466 continue;
467 }
468 if (mflag && confirm(argv[0], cp)) {
469 tp = cp;
470 if (mcase) {
471 while (*tp && !islower(*tp)) {
471 while (*tp && !islower((unsigned char)*tp)) {
472 tp++;
473 }
474 if (!*tp) {
475 tp = cp;
476 tp2 = tmpbuf;
477 while ((*tp2 = *tp) != '\0') {
472 tp++;
473 }
474 if (!*tp) {
475 tp = cp;
476 tp2 = tmpbuf;
477 while ((*tp2 = *tp) != '\0') {
478 if (isupper(*tp2)) {
478 if (isupper((unsigned char)*tp2)) {
479 *tp2 = 'a' + *tp2 - 'A';
480 }
481 tp++;
482 tp2++;
483 }
484 }
485 tp = tmpbuf;
486 }

--- 129 unchanged lines hidden (view full) ---

616 oldargv2 = argv[2];
617 if (!globulize(&argv[2])) {
618 code = -1;
619 return (0);
620 }
621 if (loc && mcase) {
622 char *tp = argv[1], *tp2, tmpbuf[MaxPathLen];
623
479 *tp2 = 'a' + *tp2 - 'A';
480 }
481 tp++;
482 tp2++;
483 }
484 }
485 tp = tmpbuf;
486 }

--- 129 unchanged lines hidden (view full) ---

616 oldargv2 = argv[2];
617 if (!globulize(&argv[2])) {
618 code = -1;
619 return (0);
620 }
621 if (loc && mcase) {
622 char *tp = argv[1], *tp2, tmpbuf[MaxPathLen];
623
624 while (*tp && !islower(*tp)) {
624 while (*tp && !islower((unsigned char)*tp)) {
625 tp++;
626 }
627 if (!*tp) {
628 tp = argv[2];
629 tp2 = tmpbuf;
630 while ((*tp2 = *tp) != '\0') {
625 tp++;
626 }
627 if (!*tp) {
628 tp = argv[2];
629 tp2 = tmpbuf;
630 while ((*tp2 = *tp) != '\0') {
631 if (isupper(*tp2)) {
631 if (isupper((unsigned char)*tp2)) {
632 *tp2 = 'a' + *tp2 - 'A';
633 }
634 tp++;
635 tp2++;
636 }
637 argv[2] = tmpbuf;
638 }
639 }

--- 92 unchanged lines hidden (view full) ---

732 continue;
733 }
734 if (mflag && suspicious_filename(cp))
735 printf("*** Suspicious filename: %s\n", cp);
736 if (mflag && confirm(argv[0], cp)) {
737 tp = cp;
738 if (mcase) {
739 for (tp2 = tmpbuf; (ch = *tp++);)
632 *tp2 = 'a' + *tp2 - 'A';
633 }
634 tp++;
635 tp2++;
636 }
637 argv[2] = tmpbuf;
638 }
639 }

--- 92 unchanged lines hidden (view full) ---

732 continue;
733 }
734 if (mflag && suspicious_filename(cp))
735 printf("*** Suspicious filename: %s\n", cp);
736 if (mflag && confirm(argv[0], cp)) {
737 tp = cp;
738 if (mcase) {
739 for (tp2 = tmpbuf; (ch = *tp++);)
740 *tp2++ = isupper(ch) ? tolower(ch) : ch;
740 *tp2++ = tolower(ch);
741 *tp2 = '\0';
742 tp = tmpbuf;
743 }
744 if (ntflag) {
745 tp = dotrans(tp);
746 }
747 if (mapflag) {
748 tp = domap(tp);

--- 1077 unchanged lines hidden (view full) ---

1826 switch (*cp2) {
1827 case '\\':
1828 if (*(cp2 + 1)) {
1829 *cp1++ = *++cp2;
1830 }
1831 break;
1832 case '[':
1833LOOP:
741 *tp2 = '\0';
742 tp = tmpbuf;
743 }
744 if (ntflag) {
745 tp = dotrans(tp);
746 }
747 if (mapflag) {
748 tp = domap(tp);

--- 1077 unchanged lines hidden (view full) ---

1826 switch (*cp2) {
1827 case '\\':
1828 if (*(cp2 + 1)) {
1829 *cp1++ = *++cp2;
1830 }
1831 break;
1832 case '[':
1833LOOP:
1834 if (*++cp2 == '$' && isdigit(*(cp2+1))) {
1834 if (*++cp2 == '$' && isdigit((unsigned char)*(cp2+1))) {
1835 if (*++cp2 == '0') {
1836 char *cp3 = name;
1837
1838 while (*cp3) {
1839 *cp1++ = *cp3++;
1840 }
1841 match = 1;
1842 }

--- 8 unchanged lines hidden (view full) ---

1851 }
1852 else {
1853 while (*cp2 && *cp2 != ',' &&
1854 *cp2 != ']') {
1855 if (*cp2 == '\\') {
1856 cp2++;
1857 }
1858 else if (*cp2 == '$' &&
1835 if (*++cp2 == '0') {
1836 char *cp3 = name;
1837
1838 while (*cp3) {
1839 *cp1++ = *cp3++;
1840 }
1841 match = 1;
1842 }

--- 8 unchanged lines hidden (view full) ---

1851 }
1852 else {
1853 while (*cp2 && *cp2 != ',' &&
1854 *cp2 != ']') {
1855 if (*cp2 == '\\') {
1856 cp2++;
1857 }
1858 else if (*cp2 == '$' &&
1859 isdigit(*(cp2+1))) {
1859 isdigit((unsigned char)*(cp2+1))) {
1860 if (*++cp2 == '0') {
1861 char *cp3 = name;
1862
1863 while (*cp3) {
1864 *cp1++ = *cp3++;
1865 }
1866 }
1867 else if (toks[toknum =

--- 35 unchanged lines hidden (view full) ---

1903 case ']':
1904 break;
1905 default:
1906 cp2--;
1907 goto LOOP;
1908 }
1909 break;
1910 case '$':
1860 if (*++cp2 == '0') {
1861 char *cp3 = name;
1862
1863 while (*cp3) {
1864 *cp1++ = *cp3++;
1865 }
1866 }
1867 else if (toks[toknum =

--- 35 unchanged lines hidden (view full) ---

1903 case ']':
1904 break;
1905 default:
1906 cp2--;
1907 goto LOOP;
1908 }
1909 break;
1910 case '$':
1911 if (isdigit(*(cp2 + 1))) {
1911 if (isdigit((unsigned char)*(cp2 + 1))) {
1912 if (*++cp2 == '0') {
1913 char *cp3 = name;
1914
1915 while (*cp3) {
1916 *cp1++ = *cp3++;
1917 }
1918 }
1919 else if (toks[toknum = *cp2 - '1']) {

--- 208 unchanged lines hidden ---
1912 if (*++cp2 == '0') {
1913 char *cp3 = name;
1914
1915 while (*cp3) {
1916 *cp1++ = *cp3++;
1917 }
1918 }
1919 else if (toks[toknum = *cp2 - '1']) {

--- 208 unchanged lines hidden ---