gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog configure.ac libbase/rc.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog configure.ac libbase/rc.cpp
Date: Tue, 21 Aug 2007 15:18:36 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/08/21 15:18:36

Modified files:
        .              : ChangeLog configure.ac 
        libbase        : rc.cpp 

Log message:
        Patch by Benjamin Wolsey <address@hidden>:
        
                * configure.ac: look for getpwnam
                * libbase/rc.cpp (expandPath): don't try to use getpwnam
                  if not provided by OS.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4059&r2=1.4060
http://cvs.savannah.gnu.org/viewcvs/gnash/configure.ac?cvsroot=gnash&r1=1.402&r2=1.403
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/rc.cpp?cvsroot=gnash&r1=1.30&r2=1.31

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4059
retrieving revision 1.4060
diff -u -b -r1.4059 -r1.4060
--- ChangeLog   21 Aug 2007 15:03:07 -0000      1.4059
+++ ChangeLog   21 Aug 2007 15:18:35 -0000      1.4060
@@ -1,3 +1,9 @@
+2007-08-21 Benjamin Wolsey <address@hidden>
+
+       * configure.ac: look for getpwnam
+       * libbase/rc.cpp (expandPath): don't try to use getpwnam
+         if not provided by OS.
+
 2007-08-21 Udo Giacomozzi <address@hidden>
 
        * gui/gui.cpp: Introduce FORCE_REDRAW macro

Index: configure.ac
===================================================================
RCS file: /sources/gnash/gnash/configure.ac,v
retrieving revision 1.402
retrieving revision 1.403
diff -u -b -r1.402 -r1.403
--- configure.ac        20 Aug 2007 17:48:09 -0000      1.402
+++ configure.ac        21 Aug 2007 15:18:36 -0000      1.403
@@ -15,7 +15,7 @@
 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 dnl  
 
-dnl $Id: configure.ac,v 1.402 2007/08/20 17:48:09 strk Exp $
+dnl $Id: configure.ac,v 1.403 2007/08/21 15:18:36 strk Exp $
 
 AC_PREREQ(2.50)
 AC_INIT(gnash, cvs)
@@ -775,6 +775,7 @@
 AC_CHECK_HEADERS(libgen.h)
 AC_CHECK_HEADERS(pwd.h)
 AC_CHECK_LIB(m, sqrt)
+AC_CHECK_LIB(c, getpwnam,AC_DEFINE(HAVE_GETPWNAM, 1, [Has getpwnam] ))
 
 dnl don't look for X11 when using a raw framebuffer for the GUI
 if test x$build_gtk = xyes -o x$build_kde = xyes -o x$build_fltk = xyes -o 
x$build_sdl = xyes; then

Index: libbase/rc.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/rc.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- libbase/rc.cpp      20 Aug 2007 22:59:26 -0000      1.30
+++ libbase/rc.cpp      21 Aug 2007 15:18:36 -0000      1.31
@@ -152,6 +152,8 @@
 RcInitFile::expandPath (std::string& unixpath)
 
 {
+
+//Don't break build on systems without passwd / getpwnam
 string _expanded;
 
               //Only if path starts with "~"
@@ -163,7 +165,10 @@
                                // if HOME set in env, replace ~ with HOME
                                _expanded = unixpath.replace(0,1,home);
                           }
+
+#ifdef HAVE_GETPWNAM
                           //HOME not set in env: try using pwd
+
                           else { 
                                struct passwd *password = getpwuid(getuid());
                                const char *pwdhome = password->pw_dir;
@@ -171,6 +176,7 @@
                                //If all that fails, leave path alone
                                else _expanded = unixpath;
                           }
+
                      }
 
                      //Initial "~" is not followed by "/"
@@ -201,9 +207,22 @@
                       }
                  }
                  //Path doesn't start with ~, leave it alone.
+
+#else
+//For systems with pwd.h but not getpwnam, nothing to do if HOME not set.
+                          else _expanded = unixpath;
+                      }
+                      else _expanded = unixpath;
+                 }
+#endif
+
+
                  else {
                       _expanded = unixpath;
                  }
+
+
+
      return _expanded;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]