[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: gsch2pcb.c



  User: danmc   
  Date: 05/02/23 20:21:25

  Modified:    .        gsch2pcb.c
  Log:
  when parsing the project file, remove trailing whitespace.  Otherwise
  
  strange things can happen.  This is especially true if the "output-name"
  
  has trailing whitespace.
  
  
  
  
  Revision  Changes    Path
  1.10      +15 -1     eda/geda/devel/utils/src/gsch2pcb.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: gsch2pcb.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/utils/src/gsch2pcb.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- gsch2pcb.c	7 Feb 2005 23:57:14 -0000	1.9
  +++ gsch2pcb.c	24 Feb 2005 01:21:25 -0000	1.10
  @@ -1,3 +1,5 @@
  +/* $Id: gsch2pcb.c,v 1.10 2005/02/24 01:21:25 danmc Exp $ */
  +
   /* gsch2pcb
   |
   |  Bill Wilson    billw@xxxxxx
  @@ -1091,8 +1093,20 @@
   static gint
   parse_config(gchar *config, gchar *arg)
   	{
  +	gchar *s;
  +	int i;
  +
  +	/* remove trailing white space otherwise strange things can happen */
  +	if ( (arg != NULL) && (strlen(arg) >= 1) )
  +		{
  +		s = arg + strlen(arg) - 1;
  +		while( (*s == ' ' || *s == '\t' ) && (s != arg) ) s--;
  +		s++;
  +		*s = '\0';
  +		}
  +
   	if (verbose)
  -		printf("    %s %s\n", config, arg ? arg : "");
  +		printf("    %s \"%s\"\n", config, arg ? arg : "");
   
   	if (!strcmp(config, "remove-unfound") || !strcmp(config, "r"))
   		{