Subject: Re: libssh2 master d002839... Fix namespace pollution.

Re: libssh2 master d002839... Fix namespace pollution.

From: Peter Stuge <peter_at_stuge.se>
Date: Fri, 19 Mar 2010 13:13:17 +0100

libssh2_at_git.stuge.se wrote:
> +++ b/src/global.c
> @@ -37,12 +37,12 @@
>
> #include "libssh2_priv.h"
>
> -int libssh2_initialized = 0;
> -int libssh2_init_flags = 0;
> +static int _libssh2_initialized = 0;
> +static int _libssh2_init_flags = 0;
>
> LIBSSH2_API int libssh2_init(int flags)
> {
> - if (!(flags & LIBSSH2_INIT_NO_CRYPTO_INIT)) {
> + if (libssh2_initialized == 0 && !(flags & LIBSSH2_INIT_NO_CRYPTO_INIT)) {
> libssh2_crypto_init();
> }
>
> @@ -57,11 +57,18 @@ LIBSSH2_API void libssh2_exit()
> if (libssh2_initialized == 0)
> return;
>
> + libssh2_initialized--;

Shouldn't these two uses of the variable be changed? Maybe there are
other places too?

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-03-19