You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by mt...@apache.org on 2021/12/02 23:58:46 UTC

svn commit: r1895517 - in /apr/apr/trunk/misc/win32: env.c start.c

Author: mturk
Date: Thu Dec  2 23:58:46 2021
New Revision: 1895517

URL: http://svn.apache.org/viewvc?rev=1895517&view=rev
Log:
TAB police ... get rid of missmatch of TAB and spaces through the code

Modified:
    apr/apr/trunk/misc/win32/env.c
    apr/apr/trunk/misc/win32/start.c

Modified: apr/apr/trunk/misc/win32/env.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/misc/win32/env.c?rev=1895517&r1=1895516&r2=1895517&view=diff
==============================================================================
--- apr/apr/trunk/misc/win32/env.c (original)
+++ apr/apr/trunk/misc/win32/env.c Thu Dec  2 23:58:46 2021
@@ -46,36 +46,36 @@ APR_DECLARE(apr_status_t) apr_env_get(ch
 {
     char *val = NULL;
     DWORD size;
-	apr_wchar_t wenvvar[APR_PATH_MAX];
-	apr_size_t inchars, outchars;
-	apr_wchar_t *wvalue, dummy;
-	apr_status_t status;
-
-	status = widen_envvar_name(wenvvar, APR_PATH_MAX, envvar);
-	if (status)
-		return status;
-
-	SetLastError(0);
-	size = GetEnvironmentVariableW(wenvvar, &dummy, 0);
-	if (GetLastError() == ERROR_ENVVAR_NOT_FOUND)
-		/* The environment variable doesn't exist. */
-		return APR_ENOENT;
-
-	if (size == 0) {
-		/* The environment value exists, but is zero-length. */
-		*value = apr_pstrdup(pool, "");
-		return APR_SUCCESS;
-	}
-
-	wvalue = apr_palloc(pool, size * sizeof(*wvalue));
-	size = GetEnvironmentVariableW(wenvvar, wvalue, size);
-
-	inchars = wcslen(wvalue) + 1;
-	outchars = 3 * inchars; /* Enough for any UTF-8 representation */
-	val = apr_palloc(pool, outchars);
-	status = apr_conv_utf16_to_utf8(wvalue, &inchars, val, &outchars);
-	if (status)
-		return status;
+    apr_wchar_t wenvvar[APR_PATH_MAX];
+    apr_size_t inchars, outchars;
+    apr_wchar_t *wvalue, dummy;
+    apr_status_t status;
+
+    status = widen_envvar_name(wenvvar, APR_PATH_MAX, envvar);
+    if (status)
+        return status;
+
+    SetLastError(0);
+    size = GetEnvironmentVariableW(wenvvar, &dummy, 0);
+    if (GetLastError() == ERROR_ENVVAR_NOT_FOUND)
+        /* The environment variable doesn't exist. */
+        return APR_ENOENT;
+
+    if (size == 0) {
+        /* The environment value exists, but is zero-length. */
+        *value = apr_pstrdup(pool, "");
+        return APR_SUCCESS;
+    }
+
+    wvalue = apr_palloc(pool, size * sizeof(*wvalue));
+    size = GetEnvironmentVariableW(wenvvar, wvalue, size);
+
+    inchars = wcslen(wvalue) + 1;
+    outchars = 3 * inchars; /* Enough for any UTF-8 representation */
+    val = apr_palloc(pool, outchars);
+    status = apr_conv_utf16_to_utf8(wvalue, &inchars, val, &outchars);
+    if (status)
+        return status;
 
     *value = val;
     return APR_SUCCESS;
@@ -86,23 +86,23 @@ APR_DECLARE(apr_status_t) apr_env_set(co
                                       const char *value,
                                       apr_pool_t *pool)
 {
-	apr_wchar_t wenvvar[APR_PATH_MAX];
-	apr_wchar_t *wvalue;
-	apr_size_t inchars, outchars;
-	apr_status_t status;
-
-	status = widen_envvar_name(wenvvar, APR_PATH_MAX, envvar);
-	if (status)
-		return status;
-
-	outchars = inchars = strlen(value) + 1;
-	wvalue = apr_palloc(pool, outchars * sizeof(*wvalue));
-	status = apr_conv_utf8_to_utf16(value, &inchars, wvalue, &outchars);
-	if (status)
-		return status;
+    apr_wchar_t wenvvar[APR_PATH_MAX];
+    apr_wchar_t *wvalue;
+    apr_size_t inchars, outchars;
+    apr_status_t status;
+
+    status = widen_envvar_name(wenvvar, APR_PATH_MAX, envvar);
+    if (status)
+        return status;
+
+    outchars = inchars = strlen(value) + 1;
+    wvalue = apr_palloc(pool, outchars * sizeof(*wvalue));
+    status = apr_conv_utf8_to_utf16(value, &inchars, wvalue, &outchars);
+    if (status)
+        return status;
 
-	if (!SetEnvironmentVariableW(wenvvar, wvalue))
-		return apr_get_os_error();
+    if (!SetEnvironmentVariableW(wenvvar, wvalue))
+        return apr_get_os_error();
 
     return APR_SUCCESS;
 }
@@ -110,15 +110,15 @@ APR_DECLARE(apr_status_t) apr_env_set(co
 
 APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool)
 {
-	apr_wchar_t wenvvar[APR_PATH_MAX];
-	apr_status_t status;
+    apr_wchar_t wenvvar[APR_PATH_MAX];
+    apr_status_t status;
 
-	status = widen_envvar_name(wenvvar, APR_PATH_MAX, envvar);
-	if (status)
-		return status;
+    status = widen_envvar_name(wenvvar, APR_PATH_MAX, envvar);
+    if (status)
+        return status;
 
-	if (!SetEnvironmentVariableW(wenvvar, NULL))
-		return apr_get_os_error();
+    if (!SetEnvironmentVariableW(wenvvar, NULL))
+        return apr_get_os_error();
 
     return APR_SUCCESS;
 }

Modified: apr/apr/trunk/misc/win32/start.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/misc/win32/start.c?rev=1895517&r1=1895516&r2=1895517&view=diff
==============================================================================
--- apr/apr/trunk/misc/win32/start.c (original)
+++ apr/apr/trunk/misc/win32/start.c Thu Dec  2 23:58:46 2021
@@ -98,56 +98,56 @@ APR_DECLARE(apr_status_t) apr_app_initia
                                              const char * const * *argv,
                                              const char * const * *env)
 {
-	apr_wchar_t **wstrs;
-	apr_wchar_t *sysstr;
-	int wstrc;
-	int dupenv;
+    apr_wchar_t **wstrs;
+    apr_wchar_t *sysstr;
+    int wstrc;
+    int dupenv;
     apr_status_t rv = apr_initialize();
 
     if (rv != APR_SUCCESS) {
         return rv;
     }
 
-	if (apr_app_init_complete) {
-		return rv;
-	}
-
-	apr_app_init_complete = 1;
-
-	sysstr = GetCommandLineW();
-	if (sysstr) {
-		wstrs = apr_winapi_CommandLineToArgvW(sysstr, &wstrc);
-		if (wstrs) {
-			*argc = apr_wastrtoastr(argv, wstrs, wstrc);
-			LocalFree(wstrs);
-		}
-	}
-
-	sysstr = GetEnvironmentStringsW();
-	dupenv = warrsztoastr(&_environ, sysstr);
-
-	if (env) {
-		*env = apr_malloc_dbg((dupenv + 1) * sizeof (char *),
-							  __FILE__, __LINE__ );
-		memcpy((void*)*env, _environ, (dupenv + 1) * sizeof (char *));
-	}
-	else {
-	}
-
-	FreeEnvironmentStringsW(sysstr);
-
-	/* MSVCRT will attempt to maintain the wide environment calls
-	 * on _putenv(), which is bogus if we've passed a non-ascii
-	 * string to _putenv(), since they use MultiByteToWideChar
-	 * and breaking the implicit utf-8 assumption we've built.
-	 *
-	 * Reset _wenviron for good measure.
-	 */
-	if (_wenviron) {
-		apr_wchar_t **wenv = _wenviron;
-		_wenviron = NULL;
-		free(wenv);
-	}
+    if (apr_app_init_complete) {
+        return rv;
+    }
+
+    apr_app_init_complete = 1;
+
+    sysstr = GetCommandLineW();
+    if (sysstr) {
+        wstrs = apr_winapi_CommandLineToArgvW(sysstr, &wstrc);
+        if (wstrs) {
+            *argc = apr_wastrtoastr(argv, wstrs, wstrc);
+            LocalFree(wstrs);
+        }
+    }
+
+    sysstr = GetEnvironmentStringsW();
+    dupenv = warrsztoastr(&_environ, sysstr);
+
+    if (env) {
+        *env = apr_malloc_dbg((dupenv + 1) * sizeof (char *),
+                              __FILE__, __LINE__ );
+        memcpy((void*)*env, _environ, (dupenv + 1) * sizeof (char *));
+    }
+    else {
+    }
+
+    FreeEnvironmentStringsW(sysstr);
+
+    /* MSVCRT will attempt to maintain the wide environment calls
+     * on _putenv(), which is bogus if we've passed a non-ascii
+     * string to _putenv(), since they use MultiByteToWideChar
+     * and breaking the implicit utf-8 assumption we've built.
+     *
+     * Reset _wenviron for good measure.
+     */
+    if (_wenviron) {
+        apr_wchar_t **wenv = _wenviron;
+        _wenviron = NULL;
+        free(wenv);
+    }
     return rv;
 }