wget support for no_proxy env var
Bernhard Fischer
rep.dot.nop at gmail.com
Tue Jun 19 08:30:55 UTC 2007
On Mon, Jun 18, 2007 at 03:23:20PM -0600, dann frazier wrote:
>hey,
> The following patch adds support for the no_proxy envvar to the wget
>applet. Most of the code is lifted directly from GNU's wget source
>(with a few simplifications). This is my first contribution to
>busybox and a rare attempt at C for me - let me know if I should
>reduce wrap this code in a config option, etc.
Yes, please wrap that in a config option.
>
>Index: networking/wget.c
>===================================================================
>--- networking/wget.c (revision 18847)
>+++ networking/wget.c (working copy)
>@@ -83,6 +83,66 @@
> }
> #endif
>
>+bool sufmatch (char **list, const char *what);
>+bool sufmatch (char **list, const char *what)
>+{
>+ int i, j, k, lw;
>+
>+ lw = strlen (what);
>+ for (i = 0; list[i]; i++) {
>+ for (j = strlen (list[i]), k = lw; j >= 0 && k >= 0; j--, k--)
>+ if (tolower (list[i][j]) != tolower (what[k]))
>+ break;
>+ /* The domain must be first to reach to beginning. */
>+ if (j == -1)
>+ return true;
>+ }
>+ return false;
>+}
This sounds alike index_in_substr_array(). Perhaps you can reuse this
instead? (See also str_tolower())
[snip]
More information about the busybox
mailing list