Update of /cvsroot/mahogany/M/lib/dspam/win32
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19169/lib/dspam/win32

Modified Files:
        auto-config.h.win32-msvc util_win32.c 
Log Message:
made dspam_set/get_home() available under Unix as well (and not only Win32)

Index: auto-config.h.win32-msvc
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/win32/auto-config.h.win32-msvc,v
retrieving revision 1.6
retrieving revision 1.7
diff -b -u -2 -r1.6 -r1.7
--- auto-config.h.win32-msvc    10 Jul 2004 19:46:12 -0000      1.6
+++ auto-config.h.win32-msvc    12 Jul 2004 18:51:21 -0000      1.7
@@ -232,12 +232,4 @@
 #endif
 
-/*
-   Using a fixed HOME is a bad idea under Windows so make it configurable
-   here.
- */
-extern void dspam_set_home(const char *home);
-extern const char *dspam_get_home(void);
-#define DSPAM_HOME (dspam_get_home())
-
 #endif /* !__auto_config_h */
 

Index: util_win32.c
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/win32/util_win32.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -u -2 -r1.1 -r1.2
--- util_win32.c        8 Jul 2004 07:14:06 -0000       1.1
+++ util_win32.c        12 Jul 2004 18:51:21 -0000      1.2
@@ -77,49 +77,2 @@
 }
 
-/*
-   DSPAM_HOME
- */
-static char dspam_home[MAX_PATH];
-
-void dspam_set_home(const char *home)
-{
-  strlcpy(dspam_home, home, sizeof(dspam_home));
-}
-
-const char *dspam_get_home(void)
-{
-  /* check if we have a valid home */
-  if ( !dspam_home[0] )
-  {
-    /*
-      determine it ourselves if we don't: note that the proper way to do this
-      would be by using SHGetFolderPath() but this function is not available on
-      earlier Windows systems and so we'd have to load it dynamically from
-      shell32.dll which is slightly painful, so let those who really want to do
-      it call our dspam_set_home() themselves instead and use the easy way here
-     */
-    const char *home = getenv("DSPAM_HOME");
-    if ( !home )
-        home = getenv("HOME");
-    if ( home )
-      dspam_set_home(home);
-    else
-    {
-      const char *homedrive = getenv("HOMEDRIVE");
-      const char *homepath = getenv("HOMEPATH");
-      if ( homedrive && homepath )
-      {
-        strlcpy(dspam_home, homedrive, sizeof(dspam_home));
-        strlcat(dspam_home, homepath, sizeof(dspam_home));
-      }
-      else
-      {
-        /* what else can we do? */
-        dspam_set_home("C:\\dspam");
-      }
-    }
-  }
-
-  return dspam_home;
-}
-



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to