aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Warmerdam <warmerdam@pobox.com>2004-09-14 18:04:34 +0000
committerFrank Warmerdam <warmerdam@pobox.com>2004-09-14 18:04:34 +0000
commit10c29a9e46c9a3e74462c6b53584bebc711db2cb (patch)
treeacc8281b6cdb900aa8a1c6d03bcd1884fe289ad1
parent543f672a7c62c9d92ade24c3c5c6f3344a2a54eb (diff)
downloadPROJ-10c29a9e46c9a3e74462c6b53584bebc711db2cb.tar.gz
PROJ-10c29a9e46c9a3e74462c6b53584bebc711db2cb.zip
* src/pj_pr_list.c: Ensure unused parameters are not included
in the returned string (provided by Eric Miller). git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1225 4e78687f-474d-0410-85f9-8d5e500ac6b2
-rw-r--r--ChangeLog5
-rw-r--r--src/pj_pr_list.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index cd6cb16a..2125010d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-14 Frank Warmerdam <warmerdam@pobox.com>
+
+ * src/pj_pr_list.c: Ensure unused parameters are not included
+ in the returned string (provided by Eric Miller).
+
2004-05-17 Frank Warmerdam <warmerdam@pobox.com>
* proj.spec: Change PACKAGE_NAME from "PROJ" to "proj".
diff --git a/src/pj_pr_list.c b/src/pj_pr_list.c
index f7a62344..0be154b9 100644
--- a/src/pj_pr_list.c
+++ b/src/pj_pr_list.c
@@ -68,6 +68,11 @@ char *pj_get_def( PJ *P, int options )
for (t = P->params; t; t = t->next)
{
+ /* skip unused parameters ... mostly appended defaults and stuff */
+ if (!t->used)
+ continue;
+
+ /* grow the resulting string if needed */
l = strlen(t->param) + 1;
if( strlen(definition) + l + 5 > def_max )
{
@@ -80,6 +85,7 @@ char *pj_get_def( PJ *P, int options )
definition = def2;
}
+ /* append this parameter */
strcat( definition, " +" );
strcat( definition, t->param );
}