[GRASS-dev] Re: [GRASS GIS] #887: db.describe fails if $GISBASE contains a space

GRASS GIS trac at osgeo.org
Thu Jan 21 05:55:35 EST 2010


#887: db.describe fails if $GISBASE contains a space
-----------------------+----------------------------------------------------
  Reporter:  hamish    |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect    |      Status:  new                      
  Priority:  normal    |   Milestone:  6.5.0                    
 Component:  Database  |     Version:  svn-releasebranch64      
Resolution:            |    Keywords:  spaces                   
  Platform:  Linux     |         Cpu:  x86-64                   
-----------------------+----------------------------------------------------
Comment (by glynn):

 Replying to [ticket:887 hamish]:

 > near EOF of lib/db/dbmi_client/start.c:
 {{{
   execl("/bin/sh", "sh", "-c", startup, NULL);
 }}}
 >
 > The startup string is set correctly; I guess execl() wants to see quotes
 in the string itself?

 execl() doesn't care; it's "sh" which wants the quotes.

 > n.b. all programs in $GISBASE/driver/db/ are ELF binaries, so is sh
 really needed at all? why not just run them directly?

 Why not, indeed ;) IOW:

 {{{
 -  execl("/bin/sh", "sh", "-c", startup, NULL);
 +  execl(startup, startup, NULL);
 }}}

 Hmm. The !__MINGW32__ version uses _spawnl(). I'm not sure whether this is
 an issue. The documentation says that arguments must be quoted, but I
 don't think that applies to the program.

 Actually ... maybe we should just replace the bulk of db_start_driver()
 with G_spawn_ex(). Redirection (including to/from pipes) should work on
 Windows now.

 > ps- building GRASS in a dir with spaces seems impossible because
 Autoconf2.13 expansion code does not always quote $srcdir.

 Forbidding spaces at compile time isn't a problem, and is probably
 inevitable. FWIW, I just use "/c/progra~1/..." for packages (e.g.
 !GnuWin32) which are installed there (although apparently it's possible to
 disable generation of 8.3 filenames).

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/887#comment:1>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list