--- aspell-0.60.4/common/aspell_win.cpp Thu Jan 1 01:00:00 1970
+++ aspell-0.60.4-modified/common/aspell_win.cpp Fri Jun 16 01:19:04 2006
@@ -0,0 +1,54 @@
-+#ifdef _WIN32\r
-+\r
-+#include <windows.h>\r
-+#include "string.hpp"\r
-+\r
-+namespace acommon {\r
-+\r
-+ String ReadRegString(HKEY hive, String key, String name)\r
-+ {\r
-+ \r
-+ // Reads a string from the Windows registry (used to get paths) \r
-+ \r
-+ HKEY hKey;\r
-+ unsigned long lType;\r
-+ DWORD dwSize;\r
-+ unsigned char* szValue = NULL;\r
-+ \r
-+ if (::RegOpenKeyEx(hive, key.c_str(), 0, KEY_READ, &hKey) == ERROR_SUCCESS)\r
-+ {\r
-+ if(::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, NULL, &dwSize) == ERROR_SUCCESS)\r
-+ {\r
-+ szValue = new unsigned char[dwSize + 1];\r
-+ ::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, szValue, &dwSize);\r
-+ String RegistryReturn((char*)szValue);\r
-+ delete[] szValue;\r
-+ return RegistryReturn;\r
-+ } else {\r
-+ return "";\r
-+ }\r
-+ } else {\r
-+ return "";\r
-+ }\r
-+ \r
-+ }\r
-+ \r
-+ HKEY GetRegHive()\r
-+ {\r
-+ \r
-+ // Check whether Aspell is installed for the current user or for all users\r
-+ \r
-+ String value;\r
-+ \r
-+ if (ReadRegString(HKEY_LOCAL_MACHINE, "Software\\Aspell", "Dictionary Path") == "")\r
-+ {\r
-+ return HKEY_CURRENT_USER;\r
-+ } else {\r
-+ return HKEY_LOCAL_MACHINE;\r
-+ }\r
-+ \r
-+ }\r
-+\r
-+} \r
-+ \r
-+#endif\r
++#ifdef _WIN32
++
++#include <windows.h>
++#include "string.hpp"
++
++namespace acommon {
++
++ String ReadRegString(HKEY hive, String key, String name)
++ {
++
++ // Reads a string from the Windows registry (used to get paths)
++
++ HKEY hKey;
++ unsigned long lType;
++ DWORD dwSize;
++ unsigned char* szValue = NULL;
++
++ if (::RegOpenKeyEx(hive, key.c_str(), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
++ {
++ if(::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, NULL, &dwSize) == ERROR_SUCCESS)
++ {
++ szValue = new unsigned char[dwSize + 1];
++ ::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, szValue, &dwSize);
++ String RegistryReturn((char*)szValue);
++ delete[] szValue;
++ return RegistryReturn;
++ } else {
++ return "";
++ }
++ } else {
++ return "";
++ }
++
++ }
++
++ HKEY GetRegHive()
++ {
++
++ // Check whether Aspell is installed for the current user or for all users
++
++ String value;
++
++ if (ReadRegString(HKEY_LOCAL_MACHINE, "Software\\Aspell", "Dictionary Path") == "")
++ {
++ return HKEY_CURRENT_USER;
++ } else {
++ return HKEY_LOCAL_MACHINE;
++ }
++
++ }
++
++}
++
++#endif
diff -riwbBuN -Xex aspell-0.60.4/common/aspell_win.hpp aspell-0.60.4-modified/common/aspell_win.hpp
--- aspell-0.60.4/common/aspell_win.hpp Thu Jan 1 01:00:00 1970
+++ aspell-0.60.4-modified/common/aspell_win.hpp Thu Jun 15 15:33:58 2006
#include "string_list.hpp"
#include "gettext.h"
-+#undef printf\r
++#undef printf
#include "iostream.hpp"
#include "iostream.hpp"
#include "gettext.h"
-+#undef printf\r
++#undef printf
namespace acommon {
#ifdef WIN32
-+# include "asc_ctype.hpp"\r
++# include "asc_ctype.hpp"
# include <io.h>
# define ACCESS _access
# include <windows.h>
--- aspell-0.60.4/common/gettext_init.cpp Tue Nov 9 09:20:24 2004
+++ aspell-0.60.4-modified/common/gettext_init.cpp Thu Jun 15 15:31:02 2006
@@ -1,5 +1,13 @@
-+#include "settings.h"\r
-+#include "string.hpp"\r
-+\r
-+#ifdef _WIN32\r
-+ #include <windows.h>\r
-+ #include "aspell_win.hpp"\r
-+#endif\r
++#include "settings.h"
++#include "string.hpp"
++
++#ifdef _WIN32
++ #include <windows.h>
++ #include "aspell_win.hpp"
++#endif
#include "gettext.h"
-+#undef printf\r
++#undef printf
#if ENABLE_NLS
if (did_init) return;
did_init = true;
- }
-+ \r
-+#ifdef _WIN32\r
-+ // Registry key for Locale Path\r
-+ \r
-+ acommon::String value;\r
-+ HKEY hive;\r
-+ \r
-+ hive = acommon::GetRegHive();\r
-+ value = acommon::ReadRegString(hive, "Software\\Aspell", "Locale Path");\r
-+ if (value == "") value = LOCALEDIR;\r
-+ \r
-+ bindtextdomain("aspell", value.c_str());\r
-+#else\r
++
++#ifdef _WIN32
++ // Registry key for Locale Path
++
++ acommon::String value;
++ HKEY hive;
++
++ hive = acommon::GetRegHive();
++ value = acommon::ReadRegString(hive, "Software\\Aspell", "Locale Path");
++ if (value == "") value = LOCALEDIR;
++
++ bindtextdomain("aspell", value.c_str());
++#else
bindtextdomain("aspell", LOCALEDIR);
-+#endif\r
++#endif
}
#else
/* BSDi defines u_intXX_t types in machine/types.h */
#include <machine/types.h>
#endif
-+\r
++
#ifdef WIN32
# include <windows.h>
# include <winbase.h>
-+#include "aspell_win.hpp"\r
++#include "aspell_win.hpp"
#endif
#include "iostream.hpp"
#include "string_map.hpp"
#include "gettext.h"
-+#undef printf\r
++#undef printf
namespace acommon {
void get_data_dirs (Config * config,
StringList & lst)
{
-+ String dictpath;\r
-+ HKEY hive;\r
-+ \r
++ String dictpath;
++ HKEY hive;
++
lst.clear();
- lst.add(config->retrieve("data-dir"));
-+\r
-+ hive = GetRegHive();\r
-+ \r
-+#ifdef _WIN32\r
-+ // Registry key for dictionary path\r
-+ dictpath = ReadRegString(hive, "Software\\Aspell", "Dictionary Path");;\r
-+ if (dictpath == "") dictpath = config->retrieve("data-dir");\r
-+#else\r
-+ dictpath = config->retrieve("data-dir");\r
-+#endif\r
-+\r
-+ lst.add(dictpath);\r
++
++ hive = GetRegHive();
++
++#ifdef _WIN32
++ // Registry key for dictionary path
++ dictpath = ReadRegString(hive, "Software\\Aspell", "Dictionary Path");;
++ if (dictpath == "") dictpath = config->retrieve("data-dir");
++#else
++ dictpath = config->retrieve("data-dir");
++#endif
++
++ lst.add(dictpath);
lst.add(config->retrieve("dict-dir"));
}
#include "posib_err.hpp"
#include "gettext.h"
-+#undef printf\r
++#undef printf
namespace acommon {
#ifdef ENABLE_NLS
-# include <langinfo.h>
-+//#include <langinfo.h>\r
++//#include <langinfo.h>
#endif
#include "gettext.h"
-+#undef printf\r
++#undef printf
namespace aspeller {
#include "hash_fun.hpp"
#include "gettext.h"
-+#undef printf\r
++#undef printf
using namespace acommon;