"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/complete.c" between
tnftp-20151004.tar.gz and tnftp-20200705.tar.gz

About: tnftp is an enhanced ftp client (prior name "lukemftp").

complete.c  (tnftp-20151004):complete.c  (tnftp-20200705)
/* $NetBSD: complete.c,v 1.10 2009/05/20 12:53:47 lukem Exp $ */ /* $NetBSD: complete.c,v 1.11 2020/07/04 09:59:07 lukem Exp $ */
/* from NetBSD: complete.c,v 1.46 2009/04/12 10:18:52 lukem Exp */ /* from NetBSD: complete.c,v 1.47 2019/01/28 12:04:16 christos Exp *
/
/*- /*-
* Copyright (c) 1997-2009 The NetBSD Foundation, Inc. * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
* All rights reserved. * All rights reserved.
* *
* This code is derived from software contributed to The NetBSD Foundation * This code is derived from software contributed to The NetBSD Foundation
* by Luke Mewburn. * by Luke Mewburn.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
skipping to change at line 39 skipping to change at line 39
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "tnftp.h" #include "tnftp.h"
#if 0 /* tnftp */ #if 0 /* tnftp */
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID(" NetBSD: complete.c,v 1.46 2009/04/12 10:18:52 lukem Exp "); __RCSID(" NetBSD: complete.c,v 1.47 2019/01/28 12:04:16 christos Exp ");
#endif /* not lint */ #endif /* not lint */
/* /*
* FTP user program - command and file completion routines * FTP user program - command and file completion routines
*/ */
#include <sys/stat.h> #include <sys/stat.h>
#include <ctype.h> #include <ctype.h>
#include <err.h> #include <err.h>
skipping to change at line 109 skipping to change at line 109
if (*p == '\0') /* at end of word? */ if (*p == '\0') /* at end of word? */
return (CC_REFRESH); return (CC_REFRESH);
ftpvis(insertstr, sizeof(insertstr), p, strlen(p)); ftpvis(insertstr, sizeof(insertstr), p, strlen(p));
if (el_insertstr(el, insertstr) == -1) if (el_insertstr(el, insertstr) == -1)
return (CC_ERROR); return (CC_ERROR);
else else
return (CC_REFRESH); return (CC_REFRESH);
} }
if (!list) { if (!list) {
matchlen = 0;
lastmatch = words->sl_str[0]; lastmatch = words->sl_str[0];
matchlen = strlen(lastmatch); matchlen = strlen(lastmatch);
for (i = 1 ; i < words->sl_cur ; i++) { for (i = 1 ; i < words->sl_cur ; i++) {
for (j = wordlen ; j < strlen(words->sl_str[i]); j++) for (j = wordlen; j < strlen(words->sl_str[i]); j++)
if (lastmatch[j] != words->sl_str[i][j]) if (lastmatch[j] != words->sl_str[i][j])
break; break;
if (j < matchlen) if (j < matchlen)
matchlen = j; matchlen = j;
} }
if (matchlen > wordlen) { if (matchlen > wordlen) {
ftpvis(insertstr, sizeof(insertstr), ftpvis(insertstr, sizeof(insertstr),
lastmatch + wordlen, matchlen - wordlen); lastmatch + wordlen, matchlen - wordlen);
if (el_insertstr(el, insertstr) == -1) if (el_insertstr(el, insertstr) == -1)
return (CC_ERROR); return (CC_ERROR);
 End of changes. 4 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)