diff options
| author | abhinav <abhinav@NetBSD.org> | 2019-04-20 08:44:10 +0000 |
|---|---|---|
| committer | abhinav <abhinav@NetBSD.org> | 2019-04-20 08:44:10 +0000 |
| commit | 7700a969b278bcbd25d949178dd93af17c5e1152 (patch) | |
| tree | d91e2d0f039f1caad4955ec83dcae698385096c0 /lib/libedit | |
| parent | eaf7b5b0aadb66e0c533ebaaf8ab96321d90353d (diff) | |
PR lib/54131 - declare the loop variable outside the for loop
Diffstat (limited to 'lib/libedit')
| -rw-r--r-- | lib/libedit/filecomplete.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libedit/filecomplete.c b/lib/libedit/filecomplete.c index d9b313f28ce..1e3c031a714 100644 --- a/lib/libedit/filecomplete.c +++ b/lib/libedit/filecomplete.c @@ -1,4 +1,4 @@ -/* $NetBSD: filecomplete.c,v 1.54 2019/04/12 15:12:29 christos Exp $ */ +/* $NetBSD: filecomplete.c,v 1.55 2019/04/20 08:44:10 abhinav Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: filecomplete.c,v 1.54 2019/04/12 15:12:29 christos Exp $"); +__RCSID("$NetBSD: filecomplete.c,v 1.55 2019/04/20 08:44:10 abhinav Exp $"); #endif /* not lint && not SCCSID */ #include <sys/types.h> @@ -177,11 +177,12 @@ needs_dquote_escaping(char c) static wchar_t * unescape_string(const wchar_t *string, size_t length) { + size_t i; + size_t j = 0; wchar_t *unescaped = el_malloc(sizeof(*string) * (length + 1)); if (unescaped == NULL) return NULL; - size_t j = 0; - for (size_t i = 0; i < length ; i++) { + for (i = 0; i < length ; i++) { if (string[i] == '\\') continue; unescaped[j++] = string[i]; |
