[GRASS-SVN] r54437 - grass/trunk/display/d.linegraph

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 28 02:52:38 PST 2012


Author: lucadelu
Date: 2012-12-28 02:52:38 -0800 (Fri, 28 Dec 2012)
New Revision: 54437

Modified:
   grass/trunk/display/d.linegraph/d.linegraph.html
   grass/trunk/display/d.linegraph/main.c
Log:
d.linegraph removed answer to directory option, fix also documentation

Modified: grass/trunk/display/d.linegraph/d.linegraph.html
===================================================================
--- grass/trunk/display/d.linegraph/d.linegraph.html	2012-12-28 09:35:16 UTC (rev 54436)
+++ grass/trunk/display/d.linegraph/d.linegraph.html	2012-12-28 10:52:38 UTC (rev 54437)
@@ -18,9 +18,8 @@
 
 <p><dl>
 <dt><b>directoryname</b>
-<dd>Path to the directory where the input files are located. If this option
-is not used, the <em>d.linegraph</em> looks for files in the current directory.
-<dd>Example format: directory/usr/grass/data/graph
+<dd>Path to the directory where the input files are located. 
+<dd>Example format: /usr/grass/data/graph
 
 <dt><b>ycoloroption[,option,...]]</b>
 <dd>Color to be used for drawing the lines in the graph. If multiple Y data

Modified: grass/trunk/display/d.linegraph/main.c
===================================================================
--- grass/trunk/display/d.linegraph/main.c	2012-12-28 09:35:16 UTC (rev 54436)
+++ grass/trunk/display/d.linegraph/main.c	2012-12-28 10:52:38 UTC (rev 54437)
@@ -139,7 +139,8 @@
     dir_opt->description = _("Path to file location");
     dir_opt->type = TYPE_STRING;
     dir_opt->required = NO;
-    dir_opt->answer = ".";
+    /* Remove answer because create problem with full path */
+    /* dir_opt->answer = "."; */
 
     y_color_opt = G_define_option();
     y_color_opt->key = "y_color";
@@ -193,7 +194,11 @@
        notice that in[0] will be the X file, and in[1-10]
        will be the Y file(s) */
 
-    sprintf(in[0].full_name, "%s/%s", dir_opt->answer, x_opt->answer);
+    if (dir_opt->answer != NULL) {
+	sprintf(in[0].full_name, "%s/%s", dir_opt->answer, x_opt->answer);
+    } else {
+	sprintf(in[0].full_name, "%s", x_opt->answer);
+    }
     sprintf(in[0].name, "%s", x_opt->answer);
 
     if ((in[0].fp = fopen(in[0].full_name, "r")) == NULL)
@@ -204,7 +209,12 @@
     /* open all Y data files */
 
     for (i = 0, j = 1; (name = y_opt->answers[i]); i++, j++) {
-	sprintf(in[j].full_name, "%s/%s", dir_opt->answer, name);
+      
+	if (dir_opt->answer != NULL) {
+	    sprintf(in[j].full_name, "%s/%s", dir_opt->answer, name);
+	} else {
+	    sprintf(in[j].full_name, "%s", name);
+	}
 	sprintf(in[j].name, "%s", name);
 
 	if ((in[j].fp = fopen(in[j].full_name, "r")) == NULL)



More information about the grass-commit mailing list