[GRASS-SVN] r42736 - grass/branches/develbranch_6/general/g.access

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 9 09:24:04 EDT 2010


Author: hamish
Date: 2010-07-09 13:24:04 +0000 (Fri, 09 Jul 2010)
New Revision: 42736

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

Modified: grass/branches/develbranch_6/general/g.access/exp_perms.c
===================================================================
--- grass/branches/develbranch_6/general/g.access/exp_perms.c	2010-07-09 12:02:24 UTC (rev 42735)
+++ grass/branches/develbranch_6/general/g.access/exp_perms.c	2010-07-09 13:24:04 UTC (rev 42736)
@@ -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/branches/develbranch_6/general/g.access/main.c
===================================================================
--- grass/branches/develbranch_6/general/g.access/main.c	2010-07-09 12:02:24 UTC (rev 42735)
+++ grass/branches/develbranch_6/general/g.access/main.c	2010-07-09 13:24:04 UTC (rev 42736)
@@ -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/branches/develbranch_6/general/g.access/set_perms.c
===================================================================
--- grass/branches/develbranch_6/general/g.access/set_perms.c	2010-07-09 12:02:24 UTC (rev 42735)
+++ grass/branches/develbranch_6/general/g.access/set_perms.c	2010-07-09 13:24:04 UTC (rev 42736)
@@ -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