[GRASS-SVN] r34695 - grass/trunk/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Dec 3 20:41:50 EST 2008
Author: glynn
Date: 2008-12-03 20:41:50 -0500 (Wed, 03 Dec 2008)
New Revision: 34695
Modified:
grass/trunk/lib/gis/locale.c
grass/trunk/lib/gis/mach_name.c
grass/trunk/lib/gis/spawn.c
Log:
Various MinGW bugfixes from Rosen Matev
Modified: grass/trunk/lib/gis/locale.c
===================================================================
--- grass/trunk/lib/gis/locale.c 2008-12-03 09:36:16 UTC (rev 34694)
+++ grass/trunk/lib/gis/locale.c 2008-12-04 01:41:50 UTC (rev 34695)
@@ -30,9 +30,12 @@
return;
setlocale(LC_CTYPE, "");
+
+#if defined(HAVE_LIBINTL_H) && defined(USE_NLS)
+#ifdef LC_MESSAGES
setlocale(LC_MESSAGES, "");
+#endif
-#if defined(HAVE_LIBINTL_H) && defined(USE_NLS)
gisbase = getenv("GISBASE");
if (gisbase && *gisbase) {
char localedir[GPATH_MAX];
Modified: grass/trunk/lib/gis/mach_name.c
===================================================================
--- grass/trunk/lib/gis/mach_name.c 2008-12-03 09:36:16 UTC (rev 34694)
+++ grass/trunk/lib/gis/mach_name.c 2008-12-04 01:41:50 UTC (rev 34695)
@@ -31,7 +31,7 @@
uname(&attname);
strcpy(name, attname.nodename);
}
-#elif
+#else
strcpy(name, "unknown");
#endif
Modified: grass/trunk/lib/gis/spawn.c
===================================================================
--- grass/trunk/lib/gis/spawn.c 2008-12-03 09:36:16 UTC (rev 34694)
+++ grass/trunk/lib/gis/spawn.c 2008-12-04 01:41:50 UTC (rev 34695)
@@ -61,13 +61,13 @@
int G_spawn(const char *command, ...)
{
va_list va;
- char *args[MAX_ARGS];
+ const char *args[MAX_ARGS];
int num_args = 0;
va_start(va, command);
for (num_args = 0; num_args < MAX_ARGS;) {
- char *arg = va_arg(va, char *);
+ const char *arg = va_arg(va, const char *);
args[num_args++] = arg;
if (!arg)
@@ -81,7 +81,7 @@
return -1;
}
- return _spawnv(_P_WAIT, (char *)command, args);
+ return _spawnv(_P_WAIT, command, args);
}
#else
@@ -207,7 +207,7 @@
#ifdef __MINGW32__
-static int do_redirects(struct redirect *redirects, int num_redirects)
+static void do_redirects(struct redirect *redirects, int num_redirects)
{
if (num_redirects > 0)
G_fatal_error
@@ -224,19 +224,18 @@
return env;
}
-static int do_spawn(const char *command)
+static int do_spawn(struct spawn *sp, const char *command)
{
char **env;
int status;
- do_redirects(redirects, num_redirects);
- env = do_bindings(_environ, bindings, num_bindings);
+ do_redirects(sp->redirects, sp->num_redirects);
+ env = do_bindings(_environ, sp->bindings, sp->num_bindings);
status =
- spawnvpe(background ? _P_NOWAIT : _P_WAIT, command, (char **)args,
- env);
+ spawnvpe(sp->background ? _P_NOWAIT : _P_WAIT, command, sp->args, env);
- if (!background && status < 0)
+ if (!sp->background && status < 0)
G_warning(_("Unable to execute command"));
return status;
More information about the grass-commit
mailing list