=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/complete.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/ftp/complete.c 1997/03/14 04:32:13 1.4 --- src/usr.bin/ftp/complete.c 1997/03/21 20:59:28 1.5 *************** *** 1,5 **** ! /* $OpenBSD: complete.c,v 1.4 1997/03/14 04:32:13 millert Exp $ */ ! /* $NetBSD: complete.c,v 1.3 1997/03/13 06:23:13 lukem Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. --- 1,5 ---- ! /* $OpenBSD: complete.c,v 1.5 1997/03/21 20:59:28 millert Exp $ */ ! /* $NetBSD: complete.c,v 1.6 1997/03/16 14:24:16 lukem Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. *************** *** 37,44 **** * POSSIBILITY OF SUCH DAMAGE. */ #ifndef lint ! static char rcsid[] = "$OpenBSD: complete.c,v 1.4 1997/03/14 04:32:13 millert Exp $"; #endif /* not lint */ /* --- 37,45 ---- * POSSIBILITY OF SUCH DAMAGE. */ + #ifndef SMALL #ifndef lint ! static char rcsid[] = "$OpenBSD: complete.c,v 1.5 1997/03/21 20:59:28 millert Exp $"; #endif /* not lint */ /* *************** *** 86,92 **** return (CC_ERROR); /* no choices available */ if (words->sl_cur == 1) { /* only once choice available */ ! strcpy(insertstr, words->sl_str[0]); if (el_insertstr(el, insertstr + wordlen) == -1) return (CC_ERROR); else --- 87,93 ---- return (CC_ERROR); /* no choices available */ if (words->sl_cur == 1) { /* only once choice available */ ! (void)strcpy(insertstr, words->sl_str[0]); if (el_insertstr(el, insertstr + wordlen) == -1) return (CC_ERROR); else *************** *** 105,111 **** matchlen = j; } if (matchlen > wordlen) { ! strncpy(insertstr, lastmatch, matchlen); insertstr[matchlen] = '\0'; if (el_insertstr(el, insertstr + wordlen) == -1) return (CC_ERROR); --- 106,112 ---- matchlen = j; } if (matchlen > wordlen) { ! (void)strncpy(insertstr, lastmatch, matchlen); insertstr[matchlen] = '\0'; if (el_insertstr(el, insertstr + wordlen) == -1) return (CC_ERROR); *************** *** 167,182 **** unsigned char rv; if ((file = strrchr(word, '/')) == NULL) { ! strcpy(dir, "."); file = word; } else { ! if (file == word) ! strcpy(dir, "/"); ! else { ! strncpy(dir, word, file - word); dir[file - word] = '\0'; } ! ++file; } if ((dd = opendir(dir)) == NULL) --- 168,185 ---- unsigned char rv; if ((file = strrchr(word, '/')) == NULL) { ! dir[0] = '.'; ! dir[1] = '\0'; file = word; } else { ! if (file == word) { ! dir[0] = '/'; ! dir[1] = '\0'; ! } else { ! (void)strncpy(dir, word, file - word); dir[file - word] = '\0'; } ! file++; } if ((dd = opendir(dir)) == NULL) *************** *** 224,230 **** char *dummyargv[] = { "complete", dir, NULL }; if ((file = strrchr(word, '/')) == NULL) { ! (void)strcpy(dir, "."); file = word; } else { cp = file; --- 227,234 ---- char *dummyargv[] = { "complete", dir, NULL }; if ((file = strrchr(word, '/')) == NULL) { ! dir[0] = '.'; ! dir[1] = '\0'; file = word; } else { cp = file; *************** *** 320,326 **** len = lf->lastchar - lf->buffer; if (len >= sizeof(line)) return (CC_ERROR); ! strncpy(line, lf->buffer, len); line[len] = '\0'; cursor_pos = line + (lf->cursor - lf->buffer); lastc_argc = cursor_argc; /* remember last cursor pos */ --- 324,330 ---- len = lf->lastchar - lf->buffer; if (len >= sizeof(line)) return (CC_ERROR); ! (void)strncpy(line, lf->buffer, len); line[len] = '\0'; cursor_pos = line + (lf->cursor - lf->buffer); lastc_argc = cursor_argc; /* remember last cursor pos */ *************** *** 336,342 **** && strncmp(word, margv[cursor_argc], cursor_argo) == 0) dolist = 1; else ! strncpy(word, margv[cursor_argc], cursor_argo); word[cursor_argo] = '\0'; if (cursor_argc == 0) --- 340,346 ---- && strncmp(word, margv[cursor_argc], cursor_argo) == 0) dolist = 1; else ! (void)strncpy(word, margv[cursor_argc], cursor_argo); word[cursor_argo] = '\0'; if (cursor_argc == 0) *************** *** 376,378 **** --- 380,383 ---- return (CC_ERROR); } + #endif