From 10c29a9e46c9a3e74462c6b53584bebc711db2cb Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Tue, 14 Sep 2004 18:04:34 +0000 Subject: * 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 --- ChangeLog | 5 +++++ src/pj_pr_list.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index cd6cb16a..2125010d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-14 Frank Warmerdam + + * src/pj_pr_list.c: Ensure unused parameters are not included + in the returned string (provided by Eric Miller). + 2004-05-17 Frank Warmerdam * 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 ); } -- cgit v1.2.3