[GRASS-SVN] r42737 - grass/trunk/general/g.access

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 9 09:25:23 EDT 2010


Author: hamish
Date: 2010-07-09 13:25:23 +0000 (Fri, 09 Jul 2010)
New Revision: 42737

Modified:
   grass/trunk/general/g.access/exp_perms.c
   grass/trunk/general/g.access/main.c
   grass/trunk/general/g.access/set_perms.c
Log:
no chmod on MS-Windows, GPATH_MAX, i18n (adventures in sentence structure): merge from 6.5svn

Modified: grass/trunk/general/g.access/exp_perms.c
===================================================================
--- grass/trunk/general/g.access/exp_perms.c	2010-07-09 13:24:04 UTC (rev 42736)
+++ grass/trunk/general/g.access/exp_perms.c	2010-07-09 13:25:23 UTC (rev 42737)
@@ -1,32 +1,34 @@
 #include <grass/gis.h>
+#include <grass/glocale.h>
+
 char *explain_perms(int group, int other, int will)
 {
-    static char buf[128];
+    static char buf[256];
     char *who;
     char *verb;
     char *read;
 
-    verb = "have";
-    read = "read ";
+    verb = _("have");
+    read = _("read ");
     read = "";			/* remove this to have "read" appear */
     if (group && other) {
-	who = "Everyone";
-	verb = "has";
+	who = _("Everyone");
+	verb = _("has");
     }
     else if (group) {
-	who = "Only users in your group";
+	who = _("Only users in your group");
     }
     else if (other) {
-	who = "Only users outside your group";
+	who = _("Only users outside your group");
     }
     else {
-	who = "Only you";
+	who = _("Only you");
 	read = "";
     }
     if (will)
-	verb = "have";
+	verb = _("have");
 
-    sprintf(buf, "%s %s %s %saccess to mapset %s",
-	    who, will ? "will" : "now", verb, read, G_mapset());
+    sprintf(buf, _("%s %s %s %saccess to mapset %s"),
+	    who, will ? _("will") : _("now"), verb, read, G_mapset());
     return buf;
 }

Modified: grass/trunk/general/g.access/main.c
===================================================================
--- grass/trunk/general/g.access/main.c	2010-07-09 13:24:04 UTC (rev 42736)
+++ grass/trunk/general/g.access/main.c	2010-07-09 13:25:23 UTC (rev 42737)
@@ -24,7 +24,7 @@
 
 int main(int argc, char *argv[])
 {
-    char path[1024];
+    char path[GPATH_MAX];
     int perms;			/* full mapset permissions */
     int group, other;		/* bool. want group/other permission */
     struct Option *group_opt, *other_opt;
@@ -55,6 +55,10 @@
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
+#ifdef __MINGW32__
+    G_fatal_error(_("UNIX filesystem access controls are not supported by MS-Windows"));
+#endif
+
     /* get the unix file name for the mapset directory */
     G__file_name(path, "", "", G_mapset());
 

Modified: grass/trunk/general/g.access/set_perms.c
===================================================================
--- grass/trunk/general/g.access/set_perms.c	2010-07-09 13:24:04 UTC (rev 42736)
+++ grass/trunk/general/g.access/set_perms.c	2010-07-09 13:25:23 UTC (rev 42737)
@@ -2,6 +2,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <grass/gis.h>
+#include <grass/glocale.h>
 #include "access.h"
 #include "local_proto.h"
 
@@ -22,7 +23,7 @@
     if (chmod(path, perms) == 0)
 	fprintf(stdout, "%s\n", explain_perms(group, other, 0));
     else
-	G_fatal_error("unable to change mapset permissions");
+	G_fatal_error(_("Unable to change mapset permissions"));
 
     return 0;
 }



More information about the grass-commit mailing list