1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Nuked almost all trailing white space.

We better do this once and for all instead of cluttering all future
commits with diffs of trailing white spaces.  In the majority of cases
blank or single lines are affected and thus this change won't disturb
a git blame too much.  For future commits the pre-commit scripts
checks that this won't happen again.
This commit is contained in:
Werner Koch 2011-02-04 12:57:53 +01:00
parent ffd099eb19
commit b008274afd
305 changed files with 5385 additions and 5592 deletions

View file

@ -36,7 +36,7 @@ static HKEY
get_root_key(const char *root)
{
HKEY root_key;
if (!root)
root_key = HKEY_CURRENT_USER;
else if (!strcmp( root, "HKEY_CLASSES_ROOT" ) )
@ -53,7 +53,7 @@ get_root_key(const char *root)
root_key = HKEY_CURRENT_CONFIG;
else
return NULL;
return root_key;
}
@ -69,10 +69,10 @@ read_w32_registry_string (const char *root, const char *dir, const char *name)
DWORD n1, nbytes, type;
char *result = NULL;
wchar_t *wdir, *wname;
if ( !(root_key = get_root_key(root) ) )
return NULL;
wdir = utf8_to_wchar (dir);
if (!wdir)
return NULL;
@ -115,7 +115,7 @@ read_w32_registry_string (const char *root, const char *dir, const char *name)
goto leave;
}
result[nbytes] = 0; /* Make sure it is a string. */
result[nbytes+1] = 0;
result[nbytes+1] = 0;
if (type == REG_SZ || type == REG_EXPAND_SZ)
{
wchar_t *tmp = (void*)result;
@ -131,10 +131,10 @@ read_w32_registry_string (const char *root, const char *dir, const char *name)
HKEY root_key, key_handle;
DWORD n1, nbytes, type;
char *result = NULL;
if ( !(root_key = get_root_key(root) ) )
return NULL;
if (RegOpenKeyEx (root_key, dir, 0, KEY_READ, &key_handle) )
{
if (root)
@ -160,7 +160,7 @@ read_w32_registry_string (const char *root, const char *dir, const char *name)
if (type == REG_EXPAND_SZ && strchr (result, '%'))
{
char *tmp;
n1 += 1000;
tmp = jnlib_malloc (n1+1);
if (!tmp)
@ -177,7 +177,7 @@ read_w32_registry_string (const char *root, const char *dir, const char *name)
if (nbytes && nbytes > n1)
{
/* Oops - truncated, better don't expand at all. */
jnlib_free (tmp);
jnlib_free (tmp);
goto leave;
}
tmp[nbytes] = 0;
@ -192,14 +192,14 @@ read_w32_registry_string (const char *root, const char *dir, const char *name)
result = jnlib_malloc (strlen (tmp)+1);
if (!result)
result = tmp;
else
else
{
strcpy (result, tmp);
jnlib_free (tmp);
}
}
else
{
else
{
/* Error - don't expand. */
jnlib_free (tmp);
}
@ -215,7 +215,7 @@ read_w32_registry_string (const char *root, const char *dir, const char *name)
/* Note: This code is not well tested. However, it is not used in
GnuPG. */
int
write_w32_registry_string (const char *root, const char *dir,
write_w32_registry_string (const char *root, const char *dir,
const char *name, const char *value)
{
HKEY root_key, reg_key;
@ -236,7 +236,7 @@ write_w32_registry_string (const char *root, const char *dir,
return -1;
}
jnlib_free (wdir);
if (name)
{
wname = utf8_to_wchar (name);
@ -253,12 +253,12 @@ write_w32_registry_string (const char *root, const char *dir,
return -1;
}
if (RegSetValueEx (reg_key, wname, 0, REG_SZ,
if (RegSetValueEx (reg_key, wname, 0, REG_SZ,
(BYTE *)wvalue, wcslen (wvalue)) != ERROR_SUCCESS )
{
if (RegCreateKeyEx (root_key, wname, 0, NULL, 0, 0, NULL,
&reg_key, &disp) != ERROR_SUCCESS)
&reg_key, &disp) != ERROR_SUCCESS)
{
RegCloseKey(reg_key);
jnlib_free (wname);
@ -274,7 +274,7 @@ write_w32_registry_string (const char *root, const char *dir,
return -1;
}
}
jnlib_free (wname);
jnlib_free (wvalue);
RegCloseKey (reg_key);
@ -283,15 +283,15 @@ write_w32_registry_string (const char *root, const char *dir,
if ( !(root_key = get_root_key(root) ) )
return -1;
if ( RegOpenKeyEx( root_key, dir, 0, KEY_WRITE, &reg_key )
if ( RegOpenKeyEx( root_key, dir, 0, KEY_WRITE, &reg_key )
!= ERROR_SUCCESS )
return -1;
if ( RegSetValueEx (reg_key, name, 0, REG_SZ, (BYTE *)value,
if ( RegSetValueEx (reg_key, name, 0, REG_SZ, (BYTE *)value,
strlen( value ) ) != ERROR_SUCCESS )
{
if ( RegCreateKey( root_key, name, &reg_key ) != ERROR_SUCCESS )
if ( RegCreateKey( root_key, name, &reg_key ) != ERROR_SUCCESS )
{
RegCloseKey(reg_key);
return -1;
@ -303,7 +303,7 @@ write_w32_registry_string (const char *root, const char *dir,
return -1;
}
}
RegCloseKey (reg_key);
return 0;
#endif /*!HAVE_W32CE_SYSTEM*/