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

gEDA-cvs: branch: master updated (1.5.0-20080706-24-gb86ffc4)



The branch, master has been updated
       via  b86ffc45f699781c220153e2390a54f8b823a930 (commit)
       via  06dc1e65b688f88695e47dd38cd9022eb67bbb7c (commit)
       via  6b15947087caebaa4c85805799362c169e09adba (commit)
       via  d5b7c5788b0498155b583c40caf7615347e88641 (commit)
       via  57a4fd272e10a68e05051a9ab9309e252e2103f7 (commit)
       via  8626a1ed43da05d1b7499c4816eb372f614c0cc5 (commit)
       via  c50ba14cea1d60e21d587164612b1866d8e58bba (commit)
       via  a083568359e721485ddeec74fc7a870dc51a9b58 (commit)
       via  fa54e090d67849762c83231557bc6047bf035a03 (commit)
       via  099ece1d2669a2455501b5ee706df3016653da8c (commit)
       via  17cd47a31a4b84d02726391f980ae493d927809b (commit)
       via  872287f23b4880b01babed777efe7976783feab2 (commit)
       via  9014bf8d0a429713b642912cddcc29e1c39b9068 (commit)
       via  5d97c15d614030eb32ddc30e316fadd4d1416c6c (commit)
       via  25a40b882113ba6b710b58ad85e7cf7804d3a4ac (commit)
       via  a76cf5cdda91c7070f4765107d3f8be89bbd05b6 (commit)
       via  cd70e88b8c7faa4beea8b13b846e92807a252e63 (commit)
       via  90b0ece453efc80490c6c277386f4f5f7bfdc4af (commit)
       via  19d6d561eb5aea8e580d6ecf72d20bdfc3180ace (commit)
       via  a3513b7e6dc7bf6c36d95d4da86082beeb79831d (commit)
       via  da1d2e7b304f9d832bdee9c8dfb9fe4604e19cc9 (commit)
       via  ac84ca9171138a0774b4314fd8d8ee148d109474 (commit)
       via  2800c05634d2c66f586adc1dd0430b0d069686de (commit)
       via  c1b6775eb651c3e576eb50d9d676cf179e0b2b21 (commit)
      from  21bdf2fbbad2146234fd32a0fe04bddcaddb64f8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gattrib/configure.ac          |    2 +-
 gattrib/src/gattrib.c         |   13 +-
 gattrib/src/s_attrib.c        |    2 +-
 gattrib/src/s_object.c        |    4 +-
 gattrib/src/s_rename.c        |   19 +--
 gattrib/src/s_sheet_data.c    |    7 +-
 gattrib/src/s_table.c         |   30 +--
 gattrib/src/s_toplevel.c      |   40 ++---
 gattrib/src/x_gtksheet.c      |    4 -
 gnetlist/configure.ac         |    2 +-
 gnetlist/src/g_rc.c           |   16 +-
 gnetlist/src/gnetlist.c       |   18 +--
 gnetlist/src/i_vars.c         |    4 +-
 gnetlist/src/parsecmd.c       |   12 +-
 gnetlist/src/s_hierarchy.c    |   22 +--
 gnetlist/src/s_net.c          |   52 ++----
 gnetlist/src/s_netattrib.c    |   38 +---
 gnetlist/src/s_netlist.c      |    8 +-
 gnetlist/src/s_rename.c       |   39 +---
 gnetlist/src/s_traverse.c     |    5 +-
 gnetlist/src/vams_misc.c      |    6 +-
 gschem/configure.ac.in        |    2 +-
 gschem/src/g_hook.c           |    5 +-
 gschem/src/g_rc.c             |   10 +-
 gschem/src/gschem.c           |   19 +--
 gschem/src/gschem_dialog.c    |    4 +-
 gschem/src/i_basic.c          |    2 +-
 gschem/src/i_callbacks.c      |   39 ++--
 gschem/src/o_misc.c           |   34 +---
 gschem/src/o_picture.c        |    3 +-
 gschem/src/o_slot.c           |   27 +--
 gschem/src/o_text.c           |   18 +-
 gschem/src/o_undo.c           |   16 +-
 gschem/src/x_attribedit.c     |    4 +-
 gschem/src/x_autonumber.c     |    4 +-
 gschem/src/x_dialog.c         |   25 +--
 gschem/src/x_image.c          |    3 +-
 gschem/src/x_menus.c          |    8 +-
 gschem/src/x_multiattrib.c    |   26 +--
 gschem/src/x_pagesel.c        |    4 +-
 gschem/src/x_window.c         |    2 +-
 gsymcheck/configure.ac        |    2 +-
 gsymcheck/src/gsymcheck.c     |   14 +-
 gsymcheck/src/s_check.c       |   21 +--
 gsymcheck/src/s_symstruct.c   |    4 +-
 libgeda/configure.ac.in       |    2 +-
 libgeda/include/prototype.h   |   23 +--
 libgeda/src/f_basic.c         |  138 +++++++++++---
 libgeda/src/g_basic.c         |    2 +-
 libgeda/src/g_rc.c            |  201 ++++++-------------
 libgeda/src/g_smob.c          |   10 +-
 libgeda/src/i_vars.c          |    4 +-
 libgeda/src/o_attrib.c        |  244 ++++++++---------------
 libgeda/src/o_complex_basic.c |   16 +-
 libgeda/src/o_picture.c       |    8 +-
 libgeda/src/o_selection.c     |    3 -
 libgeda/src/o_text_basic.c    |   28 ++--
 libgeda/src/s_attrib.c        |    8 +-
 libgeda/src/s_basic.c         |  445 +++++++++--------------------------------
 libgeda/src/s_clib.c          |    3 +-
 libgeda/src/s_color.c         |   16 +-
 libgeda/src/s_conn.c          |    3 -
 libgeda/src/s_cue.c           |    3 -
 libgeda/src/s_hierarchy.c     |  163 +++++-----------
 libgeda/src/s_page.c          |   30 +++-
 libgeda/src/s_papersizes.c    |    8 +-
 libgeda/src/s_slib.c          |   50 +----
 libgeda/src/s_stretch.c       |    3 -
 libgeda/src/s_tile.c          |    3 -
 libgeda/src/s_undo.c          |    6 +-
 libgeda/src/u_basic.c         |   65 ------
 utils/configure.ac            |    2 +-
 utils/gschlas/gschlas.c       |   14 +-
 73 files changed, 679 insertions(+), 1461 deletions(-)


=================
 Commit Messages
=================

commit b86ffc45f699781c220153e2390a54f8b823a930
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:16 2008 +0200

    Refactor hierarchy function searching for parent page.
    
    Renamed s_hierarchy_up() to s_hierarchy_find_up_page() for consistency
    and modified it to return a pointer on the page found (as other
    hierarchy find functions) instead of changing the current
    page. Added description. And finally adapted gschem for this
    refactoring.

:100644 100644 e6b0b0a... dcb75fb... M	gschem/src/i_callbacks.c
:100644 100644 7628481... 0fb548c... M	libgeda/include/prototype.h
:100644 100644 102e08c... 59b4f97... M	libgeda/src/s_hierarchy.c

commit 06dc1e65b688f88695e47dd38cd9022eb67bbb7c
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:15 2008 +0200

    Simplify prototype of functions for searching pages in hierarchy.
    
    Removed 3rd parameter to s_hierarchy_find_[next|prev]_page(): now
    explicitly search for sibling page of page in 2nd parameter. Also
    added description for functions.

:100644 100644 bf68e1c... e6b0b0a... M	gschem/src/i_callbacks.c
:100644 100644 66cb893... 7628481... M	libgeda/include/prototype.h
:100644 100644 99528ec... 102e08c... M	libgeda/src/s_hierarchy.c

commit 6b15947087caebaa4c85805799362c169e09adba
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:14 2008 +0200

    Rename s_hierarchy_find_page() to s_page_search_by_page_id().
    
    Moved s_hierarchy_find_page() to libgeda s_page.c and renamed to
    s_page_search_by_page_id(). Also added description.

:100644 100644 926622b... ef29a6e... M	gschem/src/x_pagesel.c
:100644 100644 1c8ec6e... 814cf1d... M	gschem/src/x_window.c
:100644 100644 7e849c2... 66cb893... M	libgeda/include/prototype.h
:100644 100644 2d52df6... 99528ec... M	libgeda/src/s_hierarchy.c
:100644 100644 cdae0a0... cca15c6... M	libgeda/src/s_page.c

commit d5b7c5788b0498155b583c40caf7615347e88641
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:13 2008 +0200

    Remove unused function s_hierarchy_down_schematic_multiple() from libgeda.

:100644 100644 3dc1ee3... 7e849c2... M	libgeda/include/prototype.h
:100644 100644 214422c... 2d52df6... M	libgeda/src/s_hierarchy.c

commit 57a4fd272e10a68e05051a9ab9309e252e2103f7
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:12 2008 +0200

    Purge AC_CHECK_FUNCS() in configure.ac in each package of unused functions.

:100644 100644 d1c9dcc... 11a850e... M	gattrib/configure.ac
:100644 100644 3192812... e37d935... M	gnetlist/configure.ac
:100644 100644 1263569... 1515622... M	gschem/configure.ac.in
:100644 100644 2c7cd64... cefe722... M	gsymcheck/configure.ac
:100644 100644 32c7233... b71d25d... M	libgeda/configure.ac.in
:100644 100644 33795b7... 1ba3bf6... M	libgeda/src/o_selection.c
:100644 100644 017ea17... 468bca4... M	libgeda/src/s_basic.c
:100644 100644 9cb3d73... da1e10b... M	libgeda/src/s_conn.c
:100644 100644 82fa4d9... 20a9074... M	libgeda/src/s_cue.c
:100644 100644 f2fa8a7... 0b75b1d... M	libgeda/src/s_stretch.c
:100644 100644 81d2379... 8ed1ff3... M	libgeda/src/s_tile.c
:100644 100644 f259dd4... 6ac437f... M	utils/configure.ac

commit 8626a1ed43da05d1b7499c4816eb372f614c0cc5
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:11 2008 +0200

    Remove unused function vsnprintf() from libgeda.

:100644 100644 935f73e... 017ea17... M	libgeda/src/s_basic.c

commit c50ba14cea1d60e21d587164612b1866d8e58bba
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:10 2008 +0200

    Replace case conversion functions with GLib functions.
    
    Now use GLib case conversion functions, with the added benefit of UTF8
    support, instead of libgeda string_tolower() and
    string_toupper(). Consequently these two functions have been removed.

:100644 100644 edf7b65... 83f8e97... M	gschem/src/o_text.c
:100644 100644 c25f468... 0d0db44... M	gschem/src/x_dialog.c
:100644 100644 77700df... 3dc1ee3... M	libgeda/include/prototype.h
:100644 100644 1d93135... 935f73e... M	libgeda/src/s_basic.c
:100644 100644 f3057c7... 66d75fd... M	libgeda/src/s_clib.c

commit a083568359e721485ddeec74fc7a870dc51a9b58
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:09 2008 +0200

    Remove unused color stuff from libgeda.
    
    Remove unused function colornametovalue(), and unused color related
    structure and macro from libgeda s_basic.c.

:100644 100644 82e69d8... 77700df... M	libgeda/include/prototype.h
:100644 100644 a733e94... 1d93135... M	libgeda/src/s_basic.c

commit fa54e090d67849762c83231557bc6047bf035a03
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:08 2008 +0200

    Cleanup detection of attribute when editing text object in gschem.
    
    Modified the verification on the text object in gschem o_edit() to use
    o_attrib_get_name_value() instead of local custom testing code.

:100644 100644 36a8bc0... 80a70a6... M	gschem/src/o_misc.c

commit 099ece1d2669a2455501b5ee706df3016653da8c
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:07 2008 +0200

    Cleanup verification of attribute string in libgeda.
    
    Modified the test on attribute string in libgeda
    o_complex_is_eligible_attribute() to use o_attrib_get_name_value().

:100644 100644 0b8bddb... a4fb831... M	libgeda/src/o_complex_basic.c

commit 17cd47a31a4b84d02726391f980ae493d927809b
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:06 2008 +0200

    Use o_attrib_get_name_value() to parse attribute strings in gattrib.
    
    Replaced u_basic_breakup_string() with o_attrib_get_name_value() in
    gattrib when splitting attribute string for name and/or value.

:100644 100644 289305b... cf4559f... M	gattrib/src/s_attrib.c
:100644 100644 eec70bc... 547f34c... M	gattrib/src/s_object.c
:100644 100644 9ba33ef... 7fcdad9... M	gattrib/src/s_sheet_data.c
:100644 100644 d89bf68... 1807471... M	gattrib/src/s_table.c
:100644 100644 f1e9046... 4608d43... M	gattrib/src/s_toplevel.c

commit 872287f23b4880b01babed777efe7976783feab2
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:05 2008 +0200

    Cleanup of libgeda o_attrib_get_name_value().
    
    Rewrote o_attrib_get_name_value(): it now has support for UTF-8
    attribute strings ; plus it can return only the name or the value or
    both name and value.
    
    Finally adapted code wherever it can benefits this new feature.

:100644 100644 9b0d0ed... fb7094c... M	gnetlist/src/vams_misc.c
:100644 100644 303e058... 7916120... M	gschem/src/g_hook.c
:100644 100644 b548d34... 36a8bc0... M	gschem/src/o_misc.c
:100644 100644 d8363d7... a47d7c4... M	gschem/src/o_slot.c
:100644 100644 180fbbf... c25f468... M	gschem/src/x_dialog.c
:100644 100644 4aeebe8... 679d428... M	gschem/src/x_multiattrib.c
:100644 100644 f1c08d3... 82e69d8... M	libgeda/include/prototype.h
:100644 100644 ca2527e... fc1b0c9... M	libgeda/src/g_smob.c
:100644 100644 eb29775... 962789c... M	libgeda/src/o_attrib.c
:100644 100644 03cd837... 0b8bddb... M	libgeda/src/o_complex_basic.c

commit 9014bf8d0a429713b642912cddcc29e1c39b9068
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:04 2008 +0200

    Remove unused function u_basic_count_char().

:100644 100644 7713344... f1c08d3... M	libgeda/include/prototype.h
:100644 100644 fb67399... bfb9948... M	libgeda/src/u_basic.c

commit 5d97c15d614030eb32ddc30e316fadd4d1416c6c
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:03 2008 +0200

    Fix memory leak in gschem.
    
    When processing file names passed on command line, the pathname built
    for each one was not freed.

:100644 100644 7958d23... d350903... M	gschem/src/gschem.c

commit 25a40b882113ba6b710b58ad85e7cf7804d3a4ac
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:02 2008 +0200

    Remove unused functions u_basic_strip_trailing() and u_basic_has_trailing().

:100644 100644 eabf6bb... 7713344... M	libgeda/include/prototype.h
:100644 100644 7b2ed4b... fb67399... M	libgeda/src/u_basic.c

commit a76cf5cdda91c7070f4765107d3f8be89bbd05b6
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:01 2008 +0200

    Remove unnecessary strippings of trailing directory separator.
    
    These strippings is no more necessary as GLib functions for building
    filenames (in particular g_build_filename()) takes care of any
    trailing directory separator for us.

:100644 100644 3e98772... 957d0f6... M	gnetlist/src/gnetlist.c
:100644 100644 feb447d... 7958d23... M	gschem/src/gschem.c
:100644 100644 3742b0a... 6861115... M	gsymcheck/src/gsymcheck.c
:100644 100644 97e2f12... 7124d20... M	libgeda/src/g_rc.c
:100644 100644 701783c... 53d7ae0... M	utils/gschlas/gschlas.c

commit cd70e88b8c7faa4beea8b13b846e92807a252e63
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:00 2008 +0200

    Replace getcwd() with g_get_current_dir().

:100644 100644 6a717a1... 3e98772... M	gnetlist/src/gnetlist.c
:100644 100644 f142c75... feb447d... M	gschem/src/gschem.c
:100644 100644 6553e3a... 3742b0a... M	gsymcheck/src/gsymcheck.c
:100644 100644 c5222ae... ab9013c... M	libgeda/src/f_basic.c
:100644 100644 d809cf8... 701783c... M	utils/gschlas/gschlas.c

commit 90b0ece453efc80490c6c277386f4f5f7bfdc4af
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:59 2008 +0200

    Simplify build of filenames with g_build_filename() (!).
    
    Modified code where possible to use preferably g_build_filename()
    instead of g_build_path(), or g_strconcat() and friends.

:100644 100644 60b6401... 596db91... M	gattrib/src/gattrib.c
:100644 100644 fa4f628... 6a717a1... M	gnetlist/src/gnetlist.c
:100644 100644 190d950... ccbe19a... M	gschem/src/g_rc.c
:100644 100644 4e2e632... f142c75... M	gschem/src/gschem.c
:100644 100644 017af04... b58b3f5... M	gschem/src/x_autonumber.c
:100644 100644 7ddc4e2... 6553e3a... M	gsymcheck/src/gsymcheck.c
:100644 100644 cfb052f... c5222ae... M	libgeda/src/f_basic.c
:100644 100644 952397f... 97e2f12... M	libgeda/src/g_rc.c
:100644 100644 9ce2595... acc9b0c... M	libgeda/src/o_picture.c
:100644 100644 f896400... b4ac53d... M	libgeda/src/o_text_basic.c
:100644 100644 3543047... cdae0a0... M	libgeda/src/s_page.c
:100644 100644 6b553ac... d809cf8... M	utils/gschlas/gschlas.c

commit 19d6d561eb5aea8e580d6ecf72d20bdfc3180ace
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:58 2008 +0200

    Remove unnecessary check following memory allocation with GLib g_malloc().
    
    There is no need to check g_malloc() returned value as when the
    function fails to allocate memory, it terminates the application.

:100644 100644 4f9ca8c... 275fa62... M	gattrib/src/x_gtksheet.c
:100644 100644 745a84a... 15eee0a... M	gnetlist/src/s_rename.c
:100644 100644 531ce1a... a733e94... M	libgeda/src/s_basic.c

commit a3513b7e6dc7bf6c36d95d4da86082beeb79831d
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:57 2008 +0200

    Replace standard string manipulations with GLib string utility functions.

:100644 100644 d8bd735... 1399493... M	gattrib/src/s_rename.c
:100644 100644 09ddd88... fa4f628... M	gnetlist/src/gnetlist.c
:100644 100644 19adb01... bf2ef94... M	gnetlist/src/parsecmd.c
:100644 100644 11e9c47... 2f0cc06... M	gnetlist/src/s_hierarchy.c
:100644 100644 da1287b... f507fe0... M	gnetlist/src/s_net.c
:100644 100644 36a0101... ed21ebc... M	gnetlist/src/s_netattrib.c
:100644 100644 aaaf3a9... 745a84a... M	gnetlist/src/s_rename.c
:100644 100644 4f3328b... 86917fc... M	gnetlist/src/s_traverse.c
:100644 100644 d6247ec... bf68e1c... M	gschem/src/i_callbacks.c
:100644 100644 b63ddb4... d8363d7... M	gschem/src/o_slot.c
:100644 100644 3d2d2a8... f262562... M	gschem/src/o_undo.c
:100644 100644 a2aa003... 180fbbf... M	gschem/src/x_dialog.c
:100644 100644 167df2c... 0af0f3b... M	gschem/src/x_menus.c
:100644 100644 75cf75a... 476759f... M	gsymcheck/src/s_check.c
:100644 100644 e26a20e... eb29775... M	libgeda/src/o_attrib.c
:100644 100644 f0d5430... 8f52f63... M	libgeda/src/s_attrib.c
:100644 100644 b6169f2... 531ce1a... M	libgeda/src/s_basic.c
:100644 100644 2291448... cfe3457... M	libgeda/src/s_papersizes.c
:100644 100644 c5b1d5d... 2f0c569... M	libgeda/src/s_slib.c

commit da1d2e7b304f9d832bdee9c8dfb9fe4604e19cc9
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:56 2008 +0200

    Remove tests for NULL prior to freeing with g_free().
    
    Testing if pointer on memory to free is not NULL is unnecessary
    since g_free() does the test itself.

:100644 100644 fc05ad4... 9ba33ef... M	gattrib/src/s_sheet_data.c
:100644 100644 a1530a1... d89bf68... M	gattrib/src/s_table.c
:100644 100644 ca3177e... f1e9046... M	gattrib/src/s_toplevel.c
:100644 100644 ba41c67... a03a598... M	gnetlist/src/g_rc.c
:100644 100644 9db7dc8... c8203c8... M	gnetlist/src/i_vars.c
:100644 100644 cd7129b... 19adb01... M	gnetlist/src/parsecmd.c
:100644 100644 b6c8b0c... 11e9c47... M	gnetlist/src/s_hierarchy.c
:100644 100644 6eaf591... da1287b... M	gnetlist/src/s_net.c
:100644 100644 4e900b7... 36a0101... M	gnetlist/src/s_netattrib.c
:100644 100644 3aa7e06... d9e768d... M	gnetlist/src/s_netlist.c
:100644 100644 7775083... aaaf3a9... M	gnetlist/src/s_rename.c
:100644 100644 21fc5cf... 9b0d0ed... M	gnetlist/src/vams_misc.c
:100644 100644 0daadbc... 7c8410f... M	gschem/src/gschem_dialog.c
:100644 100644 6685736... 3381aa4... M	gschem/src/i_basic.c
:100644 100644 18b40c0... d6247ec... M	gschem/src/i_callbacks.c
:100644 100644 1f370af... b548d34... M	gschem/src/o_misc.c
:100644 100644 0f08c43... cf91611... M	gschem/src/o_picture.c
:100644 100644 91c5716... b63ddb4... M	gschem/src/o_slot.c
:100644 100644 7add762... edf7b65... M	gschem/src/o_text.c
:100644 100644 307d6a1... 3d2d2a8... M	gschem/src/o_undo.c
:100644 100644 08ccef5... 97cd73d... M	gschem/src/x_attribedit.c
:100644 100644 1048ac1... a2aa003... M	gschem/src/x_dialog.c
:100644 100644 0017564... d8dcb30... M	gschem/src/x_image.c
:100644 100644 d8cd0ea... 4aeebe8... M	gschem/src/x_multiattrib.c
:100644 100644 26c714e... 75cf75a... M	gsymcheck/src/s_check.c
:100644 100644 33f04de... 7c285f8... M	gsymcheck/src/s_symstruct.c
:100644 100644 daf0ce6... cfb052f... M	libgeda/src/f_basic.c
:100644 100644 5fb2f8e... 952397f... M	libgeda/src/g_rc.c
:100644 100644 644e874... ca2527e... M	libgeda/src/g_smob.c
:100644 100644 507714f... b79649d... M	libgeda/src/i_vars.c
:100644 100644 e54c5ba... e26a20e... M	libgeda/src/o_attrib.c
:100644 100644 7b8f673... 03cd837... M	libgeda/src/o_complex_basic.c
:100644 100644 c404dfb... 9ce2595... M	libgeda/src/o_picture.c
:100644 100644 e127be5... f896400... M	libgeda/src/o_text_basic.c
:100644 100644 8eca8f4... f0d5430... M	libgeda/src/s_attrib.c
:100644 100644 2eab043... b6169f2... M	libgeda/src/s_basic.c
:100644 100644 c3028b8... 6bf85f6... M	libgeda/src/s_color.c
:100644 100644 2e207c8... 214422c... M	libgeda/src/s_hierarchy.c
:100644 100644 d2369f7... 2291448... M	libgeda/src/s_papersizes.c
:100644 100644 ac5ea74... c5b1d5d... M	libgeda/src/s_slib.c
:100644 100644 791bcb8... 5fce02d... M	libgeda/src/s_undo.c

commit ac84ca9171138a0774b4314fd8d8ee148d109474
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:55 2008 +0200

    Rewrite f_normalize_filename().
    
    Modifies f_normalize_filename() to avoid using realpath() and
    resolving symlinks. It is derived from the GNU Lib C implementation of
    realpath() with glib GString and glib portable file-related functions.

:100644 100644 c3bdd49... 60b6401... M	gattrib/src/gattrib.c
:100644 100644 610611a... eabf6bb... M	libgeda/include/prototype.h
:100644 100644 cfaf94b... daf0ce6... M	libgeda/src/f_basic.c
:100644 100644 1cfd062... 540761d... M	libgeda/src/g_basic.c
:100644 100644 a0472ab... 5fb2f8e... M	libgeda/src/g_rc.c
:100644 100644 116b652... 2e207c8... M	libgeda/src/s_hierarchy.c

commit 2800c05634d2c66f586adc1dd0430b0d069686de
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:54 2008 +0200

    Rewrite s_expand_env_variables() with glib GString.

:100644 100644 ee78204... 610611a... M	libgeda/include/prototype.h
:100644 100644 6e91098... a0472ab... M	libgeda/src/g_rc.c
:100644 100644 3e4fdf7... 2eab043... M	libgeda/src/s_basic.c

commit c1b6775eb651c3e576eb50d9d676cf179e0b2b21
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:53 2008 +0200

    Rename expand_env_variables() to s_expand_env_variables().

:100644 100644 bbd3c68... ee78204... M	libgeda/include/prototype.h
:100644 100644 2e4338e... 6e91098... M	libgeda/src/g_rc.c
:100644 100644 837561b... 3e4fdf7... M	libgeda/src/s_basic.c

=========
 Changes
=========

commit b86ffc45f699781c220153e2390a54f8b823a930
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:16 2008 +0200

    Refactor hierarchy function searching for parent page.
    
    Renamed s_hierarchy_up() to s_hierarchy_find_up_page() for consistency
    and modified it to return a pointer on the page found (as other
    hierarchy find functions) instead of changing the current
    page. Added description. And finally adapted gschem for this
    refactoring.

diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index e6b0b0a..dcb75fb 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -2939,11 +2939,17 @@ DEFINE_I_CALLBACK(hierarchy_down_symbol)
 DEFINE_I_CALLBACK(hierarchy_up)
 {
   GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
+  PAGE *up_page;
 
   exit_if_null(w_current);
 
-  s_hierarchy_up(w_current->toplevel, w_current->toplevel->page_current->up);
-  x_window_set_current_page(w_current, w_current->toplevel->page_current);
+  up_page = s_hierarchy_find_up_page (w_current->toplevel->pages,
+                                      w_current->toplevel->page_current);
+  if (up_page == NULL) {
+    s_log_message(_("Cannot find any schematics above the current one!\n"));
+  } else {
+    x_window_set_current_page(w_current, up_page);
+  }
 }
 
 /*! \todo Finish function documentation!!!
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 7628481..0fb548c 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -403,7 +403,7 @@ void s_cue_output_single(TOPLEVEL *toplevel, OBJECT *object, FILE *fp, int type)
 /* s_hierarchy.c */
 int s_hierarchy_down_schematic_single(TOPLEVEL *toplevel, const gchar *filename, PAGE *parent, int page_control, int flag);
 void s_hierarchy_down_symbol (TOPLEVEL *toplevel, const CLibSymbol *symbol, PAGE *parent);
-void s_hierarchy_up(TOPLEVEL *toplevel, int pid);
+PAGE *s_hierarchy_find_up_page(GedaPageList *page_list, PAGE *current_page);
 GList* s_hierarchy_traversepages(TOPLEVEL *toplevel, gint flags);
 gint s_hierarchy_print_page(PAGE *p_current, void * data);
 PAGE *s_hierarchy_find_prev_page(GedaPageList *page_list, PAGE *current_page);
diff --git a/libgeda/src/s_hierarchy.c b/libgeda/src/s_hierarchy.c
index 102e08c..59b4f97 100644
--- a/libgeda/src/s_hierarchy.c
+++ b/libgeda/src/s_hierarchy.c
@@ -165,28 +165,28 @@ void s_hierarchy_down_symbol (TOPLEVEL *toplevel,
 
 }
 
-/*! \todo Finish function documentation!!!
- *  \brief
+/*! \brief Search for the parent page of a page in hierarchy.
  *  \par Function Description
+ *  This function searches the parent page of page \a page in the
+ *  hierarchy. It checks all the pages in the list \a page_list.
+ *
+ *  It returns a pointer on the page if found, NULL otherwise.
  *
+ *  \note
+ *  The page \a current_page must be in the list \a page_list.
+ *
+ *  \param [in] page_list    The list of pages in which to search.
+ *  \param [in] current_page The reference page for the search.
+ *  \returns A pointer on the page found or NULL if not found.
  */
-void s_hierarchy_up(TOPLEVEL *toplevel, int pid)
+PAGE *s_hierarchy_find_up_page (GedaPageList *page_list, PAGE *current_page)
 {
-  PAGE *p_current;
-
-  if (pid < 0) {
+  if (current_page->up < 0) {
     s_log_message(_("There are no schematics above the current one!\n"));
-    return;
+    return NULL;
   }
 
-  p_current = s_page_search_by_page_id(toplevel->pages, pid);
-
-  if (p_current) {
-    s_page_goto(toplevel, p_current);
-  } else {
-    s_log_message(_("Cannot find any schematics above the current one!\n"));
-    s_log_message(_("Maybe toplevel schematic page was closed/discarded?\n"));
-  }
+  return s_page_search_by_page_id (page_list, current_page->up);
 }
 
 /*! \todo Finish function documentation!!!

commit 06dc1e65b688f88695e47dd38cd9022eb67bbb7c
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:15 2008 +0200

    Simplify prototype of functions for searching pages in hierarchy.
    
    Removed 3rd parameter to s_hierarchy_find_[next|prev]_page(): now
    explicitly search for sibling page of page in 2nd parameter. Also
    added description for functions.

diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index bf68e1c..e6b0b0a 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -1680,7 +1680,7 @@ DEFINE_I_CALLBACK(page_next)
   }
 
   if (w_current->enforce_hierarchy) {
-    p_new = s_hierarchy_find_next_page(toplevel->pages, p_current, p_current->page_control);
+    p_new = s_hierarchy_find_next_page(toplevel->pages, p_current);
   } else {
     p_new = (PAGE *)iter->data;
   }
@@ -1716,7 +1716,7 @@ DEFINE_I_CALLBACK(page_prev)
   p_new = (PAGE *)iter->data;
 
   if (w_current->enforce_hierarchy) {
-    p_new = s_hierarchy_find_prev_page(toplevel->pages, p_current, p_current->page_control);
+    p_new = s_hierarchy_find_prev_page(toplevel->pages, p_current);
   } else {
     p_new = (PAGE *)iter->data;
   }
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 66cb893..7628481 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -406,8 +406,8 @@ void s_hierarchy_down_symbol (TOPLEVEL *toplevel, const CLibSymbol *symbol, PAGE
 void s_hierarchy_up(TOPLEVEL *toplevel, int pid);
 GList* s_hierarchy_traversepages(TOPLEVEL *toplevel, gint flags);
 gint s_hierarchy_print_page(PAGE *p_current, void * data);
-PAGE *s_hierarchy_find_prev_page(GedaPageList *page_list, PAGE *current_page, int page_control);
-PAGE *s_hierarchy_find_next_page(GedaPageList *page_list, PAGE *current_page, int page_control);
+PAGE *s_hierarchy_find_prev_page(GedaPageList *page_list, PAGE *current_page);
+PAGE *s_hierarchy_find_next_page(GedaPageList *page_list, PAGE *current_page);
 
 /* s_log.c */
 void s_log_init (const gchar *filename);
diff --git a/libgeda/src/s_hierarchy.c b/libgeda/src/s_hierarchy.c
index 99528ec..102e08c 100644
--- a/libgeda/src/s_hierarchy.c
+++ b/libgeda/src/s_hierarchy.c
@@ -299,12 +299,22 @@ gint s_hierarchy_print_page(PAGE *p_current, void * data)
   return 0;
 }
 
-/*! \todo Finish function documentation!!!
- *  \brief
+/*! \brief Search for a page preceding a given page in hierarchy.
  *  \par Function Description
+ *  This function searches the previous sibling of page \a page in the
+ *  hierarchy. It checks all the pages preceding \a page in the list
+ *  \a page_list.
  *
- */
-PAGE *s_hierarchy_find_prev_page (GedaPageList *page_list, PAGE *current_page, int page_control)
+ *  It returns a pointer on the page if found, NULL otherwise.
+ *
+ *  \note
+ *  The page \a current_page must be in the list \a page_list.
+ *
+ *  \param [in] page_list    The list of pages in which to search.
+ *  \param [in] current_page The reference page for the search.
+ *  \returns A pointer on the page found or NULL if not found.
+  */
+PAGE *s_hierarchy_find_prev_page (GedaPageList *page_list, PAGE *current_page)
 {
   const GList *iter;
 
@@ -314,7 +324,7 @@ PAGE *s_hierarchy_find_prev_page (GedaPageList *page_list, PAGE *current_page, i
        iter = g_list_previous (iter)) {
 
     PAGE *page = (PAGE *)iter->data;
-    if (page->page_control == page_control) {
+    if (page->page_control == current_page->page_control) {
       return page;
     }
   }
@@ -322,12 +332,22 @@ PAGE *s_hierarchy_find_prev_page (GedaPageList *page_list, PAGE *current_page, i
   return NULL;
 }
 
-/*! \todo Finish function documentation!!!
- *  \brief
+/*! \brief Search for a page following a given page in hierarchy.
  *  \par Function Description
+ *  This function searches the next sibling of page \a page in the
+ *  hierarchy. It checks all the pages following \a page in the list
+ *  \a page_list.
  *
- */
-PAGE *s_hierarchy_find_next_page (GedaPageList *page_list, PAGE *current_page, int page_control)
+ *  It returns a pointer on the page if found, NULL otherwise.
+ *
+ *  \note
+ *  The page \a current_page must be in the list \a page_list.
+ *
+ *  \param [in] page_list    The list of pages in which to search.
+ *  \param [in] current_page The reference page for the search.
+ *  \returns A pointer on the page found or NULL if not found.
+  */
+PAGE *s_hierarchy_find_next_page (GedaPageList *page_list, PAGE *current_page)
 {
   const GList *iter;
 
@@ -337,7 +357,7 @@ PAGE *s_hierarchy_find_next_page (GedaPageList *page_list, PAGE *current_page, i
        iter = g_list_next (iter)) {
 
     PAGE *page = (PAGE *)iter->data;
-    if (page->page_control == page_control) {
+    if (page->page_control == current_page->page_control) {
       return page;
     }
   }

commit 6b15947087caebaa4c85805799362c169e09adba
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:14 2008 +0200

    Rename s_hierarchy_find_page() to s_page_search_by_page_id().
    
    Moved s_hierarchy_find_page() to libgeda s_page.c and renamed to
    s_page_search_by_page_id(). Also added description.

diff --git a/gschem/src/x_pagesel.c b/gschem/src/x_pagesel.c
index 926622b..ef29a6e 100644
--- a/gschem/src/x_pagesel.c
+++ b/gschem/src/x_pagesel.c
@@ -606,8 +606,8 @@ void pagesel_update (Pagesel *pagesel)
     p_current = (PAGE *)iter->data;
     /* find every page that is not a hierarchy-down of another page */
     if (p_current->up < 0 ||
-        s_hierarchy_find_page (toplevel->pages,
-                               p_current->up) == NULL) {
+        s_page_search_by_page_id (toplevel->pages,
+                                  p_current->up) == NULL) {
       add_page (model, NULL, toplevel->pages, p_current);
     }
   }
diff --git a/gschem/src/x_window.c b/gschem/src/x_window.c
index 1c8ec6e..814cf1d 100644
--- a/gschem/src/x_window.c
+++ b/gschem/src/x_window.c
@@ -996,7 +996,7 @@ x_window_close_page (GSCHEM_TOPLEVEL *w_current, PAGE *page)
   if (page == toplevel->page_current) {
     /* as it will delete current page, select new current page */
     /* first look up in page hierarchy */
-    new_current = s_hierarchy_find_page (toplevel->pages, page->up);
+    new_current = s_page_search_by_page_id (toplevel->pages, page->up);
 
     if (new_current == NULL) {
       /* no up in hierarchy, choice is prev, next, new page */
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 7e849c2..66cb893 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -408,7 +408,6 @@ GList* s_hierarchy_traversepages(TOPLEVEL *toplevel, gint flags);
 gint s_hierarchy_print_page(PAGE *p_current, void * data);
 PAGE *s_hierarchy_find_prev_page(GedaPageList *page_list, PAGE *current_page, int page_control);
 PAGE *s_hierarchy_find_next_page(GedaPageList *page_list, PAGE *current_page, int page_control);
-PAGE *s_hierarchy_find_page(GedaPageList *page_list, int pid);
 
 /* s_log.c */
 void s_log_init (const gchar *filename);
@@ -429,6 +428,7 @@ void s_page_delete (TOPLEVEL *toplevel, PAGE *page);
 void s_page_delete_list(TOPLEVEL *toplevel);
 void s_page_goto (TOPLEVEL *toplevel, PAGE *p_new);
 PAGE *s_page_search (TOPLEVEL *toplevel, const gchar *filename);
+PAGE *s_page_search_by_page_id (GedaPageList *list, int pid);
 void s_page_print_all (TOPLEVEL *toplevel);
 gint s_page_save_all (TOPLEVEL *toplevel);
 gboolean s_page_check_changed (GedaPageList *list);
diff --git a/libgeda/src/s_hierarchy.c b/libgeda/src/s_hierarchy.c
index 2d52df6..99528ec 100644
--- a/libgeda/src/s_hierarchy.c
+++ b/libgeda/src/s_hierarchy.c
@@ -83,7 +83,7 @@ int s_hierarchy_down_schematic_single(TOPLEVEL *toplevel,
 	/* check whether this page is in the parents list */
 	for (forbear = parent; 
 	     forbear != NULL && found->pid != forbear->pid && forbear->up >= 0;
-	     forbear = s_hierarchy_find_page (toplevel->pages, forbear->up))
+	     forbear = s_page_search_by_page_id (toplevel->pages, forbear->up))
 	  ; /* void */
 
 	if (found->pid == forbear->pid) {
@@ -179,7 +179,7 @@ void s_hierarchy_up(TOPLEVEL *toplevel, int pid)
     return;
   }
 
-  p_current = s_hierarchy_find_page(toplevel->pages, pid);
+  p_current = s_page_search_by_page_id(toplevel->pages, pid);
 
   if (p_current) {
     s_page_goto(toplevel, p_current);
@@ -344,25 +344,3 @@ PAGE *s_hierarchy_find_next_page (GedaPageList *page_list, PAGE *current_page, i
 
   return NULL;
 }
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-PAGE *s_hierarchy_find_page (GedaPageList *page_list, int pid)
-{
-  const GList *iter;
-
-  for ( iter = geda_list_get_glist (page_list);
-        iter != NULL;
-        iter = g_list_next (iter) ) {
-
-    PAGE *page = (PAGE *)iter->data;
-    if (page->pid == pid) {
-      return page;
-    }
-  }
-
-  return NULL;
-}
diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
index cdae0a0..cca15c6 100644
--- a/libgeda/src/s_page.c
+++ b/libgeda/src/s_page.c
@@ -298,6 +298,31 @@ PAGE *s_page_search (TOPLEVEL *toplevel, const gchar *filename)
   return NULL;
 }
 
+/*! \brief Search for a page given its page id in a page list.
+ *  \par Function Description
+ *  This functions returns the page that have the page id \a pid in
+ *  the list of pages starting at \a page_list, or NULL if there is no
+ *  such page.
+ *
+ *  \param [in] page_list The list of page to search the page in.
+ *  \param [in] pid       The ID of the page to find.
+ *  \returns A pointer on the page found or NULL if not found.
+ */
+PAGE *s_page_search_by_page_id (GedaPageList *list, int pid)
+{
+  const GList *iter;
+
+  for ( iter = geda_list_get_glist (list);
+        iter != NULL;
+        iter = g_list_next (iter) ) {
+    PAGE *page = (PAGE *)iter->data;
+    if (page->pid == pid) {
+      return page;
+    }
+  }
+
+  return NULL;
+}
 
 /*! \brief Print full TOPLEVEL structure.
  *  \par Function Description

commit d5b7c5788b0498155b583c40caf7615347e88641
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:13 2008 +0200

    Remove unused function s_hierarchy_down_schematic_multiple() from libgeda.

diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 3dc1ee3..7e849c2 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -402,7 +402,6 @@ void s_cue_output_single(TOPLEVEL *toplevel, OBJECT *object, FILE *fp, int type)
 
 /* s_hierarchy.c */
 int s_hierarchy_down_schematic_single(TOPLEVEL *toplevel, const gchar *filename, PAGE *parent, int page_control, int flag);
-void s_hierarchy_down_schematic_multiple (TOPLEVEL *toplevel, const gchar *filename, PAGE *parent);
 void s_hierarchy_down_symbol (TOPLEVEL *toplevel, const CLibSymbol *symbol, PAGE *parent);
 void s_hierarchy_up(TOPLEVEL *toplevel, int pid);
 GList* s_hierarchy_traversepages(TOPLEVEL *toplevel, gint flags);
diff --git a/libgeda/src/s_hierarchy.c b/libgeda/src/s_hierarchy.c
index 214422c..2d52df6 100644
--- a/libgeda/src/s_hierarchy.c
+++ b/libgeda/src/s_hierarchy.c
@@ -136,71 +136,6 @@ int s_hierarchy_down_schematic_single(TOPLEVEL *toplevel,
  *  \brief
  *  \par Function Description
  *
- *  \note
- *  This function goes and finds the associated source files and loads ALL up
- *  only works for schematic files though
- *  this is basically push
- */
-void s_hierarchy_down_schematic_multiple (TOPLEVEL *toplevel,
-					  const gchar *filename, PAGE *parent) 
-{
-  char *string=NULL;
-  PAGE *save_first_page=NULL;
-  PAGE *found;
-  int loaded_schematics=0;
-
-  s_slib_search (NULL, SLIB_SEARCH_START);
-
-  string = s_slib_search (filename, SLIB_SEARCH_NEXT);
-  while (string != NULL) {
-
-    found = s_page_new(toplevel, string);
-
-    if (found) {
-      toplevel->page_current = found;
-      s_page_goto(toplevel, found);
-      g_free(string);
-      return;
-    }
-
-    f_open(toplevel, toplevel->page_current->page_filename, NULL);
-
-    if (loaded_schematics == 0) {
-      page_control_counter++;
-      save_first_page = toplevel->page_current;
-      /* parent->down = toplevel->page_current; not needed */
-      toplevel->page_current->page_control =
-        page_control_counter;
-      loaded_schematics=1;
-    } else {
-      toplevel->page_current->page_control =
-        page_control_counter;
-    }
-
-    toplevel->page_current->up = parent->pid;
-    /* toplevel->page_current->down = NULL; not needed */
-
-    g_free(string);
-
-    string = s_slib_search(filename, SLIB_SEARCH_NEXT);
-  }
-
-  s_slib_search(NULL, SLIB_SEARCH_DONE);
-
-  g_free (string);
-
-  if (loaded_schematics) {
-    toplevel->page_current = save_first_page;
-  }
-
-  s_page_goto (toplevel, toplevel->page_current);
-  
-}
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
  */
 void s_hierarchy_down_symbol (TOPLEVEL *toplevel,
 			      const CLibSymbol *symbol, PAGE *parent)

commit 57a4fd272e10a68e05051a9ab9309e252e2103f7
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:12 2008 +0200

    Purge AC_CHECK_FUNCS() in configure.ac in each package of unused functions.

diff --git a/gattrib/configure.ac b/gattrib/configure.ac
index d1c9dcc..11a850e 100644
--- a/gattrib/configure.ac
+++ b/gattrib/configure.ac
@@ -299,7 +299,7 @@ AC_C_CONST
 
 # Checks for library functions.
 AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(getcwd strstr vsnprintf snprintf getopt_long)
+AC_CHECK_FUNCS(getopt_long)
 
 
 AC_MSG_CHECKING([for optarg in unistd.h])
diff --git a/gnetlist/configure.ac b/gnetlist/configure.ac
index 3192812..e37d935 100644
--- a/gnetlist/configure.ac
+++ b/gnetlist/configure.ac
@@ -285,7 +285,7 @@ AC_C_CONST
 
 # Checks for library functions.
 AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(getcwd strstr vsnprintf snprintf)
+AC_CHECK_FUNCS(strstr)
 
 AC_MSG_CHECKING([for optarg in unistd.h])
 AC_TRY_COMPILE(
diff --git a/gschem/configure.ac.in b/gschem/configure.ac.in
index 1263569..1515622 100644
--- a/gschem/configure.ac.in
+++ b/gschem/configure.ac.in
@@ -426,7 +426,7 @@ AC_C_CONST
 
 # Checks for library functions.
 AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(getcwd strstr vsnprintf snprintf getuid getgid)
+AC_CHECK_FUNCS(strstr getuid getgid)
 
 AC_MSG_CHECKING([for optarg in unistd.h])
 AC_TRY_COMPILE(
diff --git a/gsymcheck/configure.ac b/gsymcheck/configure.ac
index 2c7cd64..cefe722 100644
--- a/gsymcheck/configure.ac
+++ b/gsymcheck/configure.ac
@@ -198,7 +198,7 @@ AC_C_CONST
 
 # Checks for library functions.
 AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(getcwd strstr vsnprintf snprintf)
+AC_CHECK_FUNCS(strstr)
 
 AC_MSG_CHECKING([for optarg in unistd.h])
 AC_TRY_COMPILE(
diff --git a/libgeda/configure.ac.in b/libgeda/configure.ac.in
index 32c7233..b71d25d 100644
--- a/libgeda/configure.ac.in
+++ b/libgeda/configure.ac.in
@@ -352,7 +352,7 @@ AC_C_CONST
 
 # Checks for library functions.
 AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(getcwd strstr vsnprintf snprintf chown)
+AC_CHECK_FUNCS(strstr chown)
 
 # 
 # Checks for header files end
diff --git a/libgeda/src/o_selection.c b/libgeda/src/o_selection.c
index 33795b7..1ba3bf6 100644
--- a/libgeda/src/o_selection.c
+++ b/libgeda/src/o_selection.c
@@ -24,9 +24,6 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
-#ifndef HAVE_VSNPRINTF
-#include <stdarg.h>
-#endif
 
 #include "libgeda_priv.h"
 
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 017ea17..468bca4 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -24,9 +24,6 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
-#ifndef HAVE_VSNPRINTF
-#include <stdarg.h>
-#endif
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
diff --git a/libgeda/src/s_conn.c b/libgeda/src/s_conn.c
index 9cb3d73..da1e10b 100644
--- a/libgeda/src/s_conn.c
+++ b/libgeda/src/s_conn.c
@@ -24,9 +24,6 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
-#ifndef HAVE_VSNPRINTF
-#include <stdarg.h>
-#endif
 
 #include "libgeda_priv.h"
 
diff --git a/libgeda/src/s_cue.c b/libgeda/src/s_cue.c
index 82fa4d9..20a9074 100644
--- a/libgeda/src/s_cue.c
+++ b/libgeda/src/s_cue.c
@@ -24,9 +24,6 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
-#ifndef HAVE_VSNPRINTF
-#include <stdarg.h>
-#endif
 
 #include "libgeda_priv.h"
 
diff --git a/libgeda/src/s_stretch.c b/libgeda/src/s_stretch.c
index f2fa8a7..0b75b1d 100644
--- a/libgeda/src/s_stretch.c
+++ b/libgeda/src/s_stretch.c
@@ -24,9 +24,6 @@
 #if HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
-#ifndef HAVE_VSNPRINTF
-#include <stdarg.h>
-#endif
 
 #include "libgeda_priv.h"
 
diff --git a/libgeda/src/s_tile.c b/libgeda/src/s_tile.c
index 81d2379..8ed1ff3 100644
--- a/libgeda/src/s_tile.c
+++ b/libgeda/src/s_tile.c
@@ -25,9 +25,6 @@
 #endif
 #include <ctype.h>
 #include <math.h>
-#ifndef HAVE_VSNPRINTF
-#include <stdarg.h>
-#endif
 
 #include "libgeda_priv.h"
 
diff --git a/utils/configure.ac b/utils/configure.ac
index f259dd4..6ac437f 100644
--- a/utils/configure.ac
+++ b/utils/configure.ac
@@ -270,7 +270,7 @@ AC_C_CONST
 
 # Checks for library functions.
 AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(getcwd strstr vsnprintf snprintf getopt_long)
+AC_CHECK_FUNCS(strstr snprintf getopt_long)
 AC_CHECK_FUNCS(strcasecmp strncasecmp stricmp strnicmp)
 
 AC_MSG_CHECKING([for optarg in unistd.h])

commit 8626a1ed43da05d1b7499c4816eb372f614c0cc5
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:11 2008 +0200

    Remove unused function vsnprintf() from libgeda.

diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 935f73e..017ea17 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -550,20 +550,6 @@ char *remove_last_nl(char *string)
   return(string);
 }
 
-#ifndef HAVE_VSNPRINTF
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-void vsnprintf(char *buff, size_t bufsiz, const char *fmt, va_list ap)
-{
-    char *tmpbuf = buff;
-
-    vsprintf(tmpbuf, fmt, ap);
-}
-#endif
-
 /*! \brief Expand environment variables in string.
  *  \par Function Description
  *  This function returns the passed string with environment variables

commit c50ba14cea1d60e21d587164612b1866d8e58bba
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:10 2008 +0200

    Replace case conversion functions with GLib functions.
    
    Now use GLib case conversion functions, with the added benefit of UTF8
    support, instead of libgeda string_tolower() and
    string_toupper(). Consequently these two functions have been removed.

diff --git a/gschem/src/o_text.c b/gschem/src/o_text.c
index edf7b65..83f8e97 100644
--- a/gschem/src/o_text.c
+++ b/gschem/src/o_text.c
@@ -291,15 +291,17 @@ void o_text_start(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
   s_delete_object_glist(toplevel, toplevel->page_current->attrib_place_list);
   toplevel->page_current->attrib_place_list = NULL;
 
-  value = toplevel->current_attribute;
-
   switch(w_current->text_caps) {
     case(LOWER):
-      string_tolower(value, value);
+      value = toplevel->current_attribute;
+      toplevel->current_attribute = g_utf8_strdown (value, -1);
+      g_free (value);
       break;
 
     case(UPPER):
-      string_toupper(value, value);
+      value = toplevel->current_attribute;
+      toplevel->current_attribute = g_utf8_strup (value, -1);
+      g_free (value);
       break;
 
     case(BOTH):
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index c25f468..0d0db44 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -120,17 +120,18 @@ void text_input_dialog_apply(GtkWidget *w, GSCHEM_TOPLEVEL *w_current)
   string =  gtk_text_iter_get_text (&start, &end);
 
   if (string[0] != '\0' ) {
+    gchar *tmp = NULL;
     len = strlen(string);
 #if DEBUG
     printf("text was: _%s_ %d\n", string, len);
 #endif
     switch(w_current->text_caps) {
       case(LOWER):
-        string_tolower(string, string);
+        tmp = g_utf8_strdown (string, -1);
         break;
 
       case(UPPER):
-        string_toupper(string, string);
+        tmp = g_utf8_strup (string, -1);
         break;
 
       case(BOTH):
@@ -143,7 +144,8 @@ void text_input_dialog_apply(GtkWidget *w, GSCHEM_TOPLEVEL *w_current)
     select_all_text_in_textview(GTK_TEXT_VIEW(tientry));
     gtk_widget_grab_focus(tientry);
 
-    o_attrib_set_string(toplevel, string);
+    o_attrib_set_string(toplevel, tmp == NULL ? string : tmp);
+    g_free (tmp);
     toplevel->page_current->CHANGED=1;
     w_current->event_state = DRAWTEXT;
     w_current->inside_action = 1;
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 77700df..3dc1ee3 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -342,8 +342,6 @@ void s_delete(TOPLEVEL *toplevel, OBJECT *o_current);
 void s_delete_list_fromstart(TOPLEVEL *toplevel, OBJECT *start);
 void s_delete_object_glist(TOPLEVEL *toplevel, GList *list);
 OBJECT *s_remove(TOPLEVEL *toplevel, OBJECT *object);
-void string_toupper(char *in, char *out);
-void string_tolower(char *in, char *out);
 char *remove_nl(char *string);
 char *remove_last_nl(char *string);
 gchar *s_expand_env_variables (const gchar *string);
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 1d93135..935f73e 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -512,41 +512,6 @@ OBJECT *s_remove(TOPLEVEL *toplevel, OBJECT *object)
  *  \par Function Description
  *
  */
-/* Done */
-void string_toupper(char *in, char *out)
-{
-  int len;
-  int i;
-
-  len = strlen(in);
-
-  for (i = 0 ; i < len ; i++) {
-    out[i] = toupper(in[i]);
-  }
-}
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-void string_tolower(char *in, char *out)
-{
-	int len;
-	int i;
-
-	len = strlen(in);
-
-	for (i = 0 ; i < len ; i++) {
-		out[i] = tolower(in[i]);
-	}
-}
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
 /* used by o_text_read */
 char *remove_nl(char *string)
 {
diff --git a/libgeda/src/s_clib.c b/libgeda/src/s_clib.c
index f3057c7..66d75fd 100644
--- a/libgeda/src/s_clib.c
+++ b/libgeda/src/s_clib.c
@@ -606,8 +606,7 @@ static void refresh_directory (CLibSource *source)
     if (source_has_symbol (source, entry) != NULL) continue;
     
     /* skip filenames which don't have the right suffix. */
-    low_entry = g_strdup(entry);
-    string_tolower (low_entry, low_entry);
+    low_entry = g_utf8_strdown (entry, -1);
     if (!g_str_has_suffix (low_entry, SYM_FILENAME_FILTER)) {
       g_free (low_entry);
       continue;

commit a083568359e721485ddeec74fc7a870dc51a9b58
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:09 2008 +0200

    Remove unused color stuff from libgeda.
    
    Remove unused function colornametovalue(), and unused color related
    structure and macro from libgeda s_basic.c.

diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 82e69d8..77700df 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -344,7 +344,6 @@ void s_delete_object_glist(TOPLEVEL *toplevel, GList *list);
 OBJECT *s_remove(TOPLEVEL *toplevel, OBJECT *object);
 void string_toupper(char *in, char *out);
 void string_tolower(char *in, char *out);
-int colornametovalue(char *string);
 char *remove_nl(char *string);
 char *remove_last_nl(char *string);
 gchar *s_expand_env_variables (const gchar *string);
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index a733e94..1d93135 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -40,30 +40,6 @@
 /*! this is modified here and in o_list.c */
 int global_sid=0;
 
-#define NUMCOLORS 9  /*!< */
-
-/*! \brief */
-struct st_old_colors {
-        char *name;
-        int value;
-};
-
-/*! \brief
- * Colors must be in alphabetical order
- * be sure that you update above define
- */
-struct st_old_colors old_colors[] = {
-	{ "black", 0 },
-	{ "blue", 4 },
-	{ "cyan", 6 },
-	{ "green", 3 },
-	{ "grey", 7 }, 
-	{ "grey90", 8 },
-	{ "red", 2 },
-	{ "white", 1 },
-	{ "yellow", 5 },
-};
-
 /*! \todo Finish function documentation!!!
  *  \brief
  *  \par Function Description
@@ -571,42 +547,6 @@ void string_tolower(char *in, char *out)
  *  \par Function Description
  *
  */
-int colornametovalue(char *string)
-{
-	
-  int lower = 0; 
-  int upper = NUMCOLORS - 1;
-  int middle;
-  int val;
-  struct st_old_colors *ptr=NULL;
-
-  if (!string) {
-    return(-1);
-  }
-
-  string_tolower(string, string);
-  while (lower <= upper) {
-    middle = (lower + upper) / 2;
-
-    ptr = &old_colors[middle];
-    val = strcmp (ptr->name, string);
-
-    if (val < 0) {
-      lower = middle + 1;
-    } else if (val == 0) {
-      return(ptr->value);
-    } else {
-      upper = middle - 1;
-    }
-  }                
-  return(-1);
-}
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
 /* used by o_text_read */
 char *remove_nl(char *string)
 {

commit fa54e090d67849762c83231557bc6047bf035a03
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:08 2008 +0200

    Cleanup detection of attribute when editing text object in gschem.
    
    Modified the verification on the text object in gschem o_edit() to use
    o_attrib_get_name_value() instead of local custom testing code.

diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index 36a8bc0..80a70a6 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -51,9 +51,7 @@
  */
 void o_edit(GSCHEM_TOPLEVEL *w_current, GList *list)
 {
-  char *equal_ptr;
   OBJECT *o_current;
-  int num_lines = 0;
 
   if (list == NULL) {
     w_current->inside_action = 0;
@@ -83,29 +81,10 @@ void o_edit(GSCHEM_TOPLEVEL *w_current, GList *list)
     picture_change_filename_dialog(w_current);
     break;
     case(OBJ_TEXT):
-    if(strchr(o_current->text->string,'=')) {
-
-      /* now really make sure it's an attribute by
-       * checking that there are NO spaces around the ='s
-       */
-      equal_ptr = strchr(o_current->text->string, '=');
-
-      /* and also make sure it is only a single line */
-      num_lines = o_text_num_lines(o_current->text->string);
-
-      /* there is a possiblity for core dump yes? */
-      /* by exceeding the size of the text_string? */
-      /* or maybe not, since if the ='s is at the end of */
-      /* the string, there better be a null after it! */
-      if ( (*(equal_ptr + 1) != ' ') &&
-           (*(equal_ptr - 1) != ' ') &&
-           (num_lines == 1) ) {
+    if (o_attrib_get_name_value (o_current->text->string, NULL, NULL) &&
+        /* attribute editor only accept 1-line values for attribute */
+        o_text_num_lines (o_current->text->string) == 1) {
         attrib_edit_dialog(w_current,o_current, FROM_MENU);
-        /* multi_attrib_edit(w_current, o_current); */
-
-      } else {
-        o_text_edit(w_current, o_current);
-      }
     } else {
       o_text_edit(w_current, o_current);
     }

commit 099ece1d2669a2455501b5ee706df3016653da8c
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:07 2008 +0200

    Cleanup verification of attribute string in libgeda.
    
    Modified the test on attribute string in libgeda
    o_complex_is_eligible_attribute() to use o_attrib_get_name_value().

diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 0b8bddb..a4fb831 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -233,7 +233,6 @@ int o_complex_is_eligible_attribute (TOPLEVEL *toplevel, OBJECT *object,
   char *name = NULL;
   char *padded_name = NULL;
   int promotableAttribute = FALSE;
-  char *ptr;
 
   g_return_val_if_fail(object != NULL, FALSE);
 
@@ -243,8 +242,7 @@ int o_complex_is_eligible_attribute (TOPLEVEL *toplevel, OBJECT *object,
   }
 
   /* Make sure text item is an attribute */
-  ptr = strchr(object->text->string, '=');
-  if (!ptr || ptr[1] == '\0' || ptr[1] == ' ')
+  if (!o_attrib_get_name_value (object->text->string, NULL, NULL))
   {
     return FALSE;  /* not an attribute */
   }

commit 17cd47a31a4b84d02726391f980ae493d927809b
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:06 2008 +0200

    Use o_attrib_get_name_value() to parse attribute strings in gattrib.
    
    Replaced u_basic_breakup_string() with o_attrib_get_name_value() in
    gattrib when splitting attribute string for name and/or value.

diff --git a/gattrib/src/s_attrib.c b/gattrib/src/s_attrib.c
index 289305b..cf4559f 100644
--- a/gattrib/src/s_attrib.c
+++ b/gattrib/src/s_attrib.c
@@ -52,7 +52,7 @@ int s_attrib_name_in_list(STRING_LIST *name_value_list, char *name)
 
   local_list_item = name_value_list;
   while (local_list_item != NULL) {
-    local_name =  u_basic_breakup_string(local_list_item->data, '=', 0);
+    o_attrib_get_name_value(local_list_item->data, &local_name, NULL);
     if (strcmp(local_name, name) == 0) {
       return TRUE;
     }
diff --git a/gattrib/src/s_object.c b/gattrib/src/s_object.c
index eec70bc..547f34c 100644
--- a/gattrib/src/s_object.c
+++ b/gattrib/src/s_object.c
@@ -161,7 +161,7 @@ void s_object_replace_attrib_in_object(OBJECT *o_current,
       
       /* may need to check more thoroughly here. . . . */
       old_attrib_text = g_strdup(a_current->object->text->string);
-      old_attrib_name = u_basic_breakup_string(old_attrib_text, '=', 0);
+      o_attrib_get_name_value(old_attrib_text, &old_attrib_name, NULL);
       
       if (strcmp(old_attrib_name, new_attrib_name) == 0) {
 	/* create attrib=value text string & stuff it back into pr_current */
@@ -214,7 +214,7 @@ void s_object_remove_attrib_in_object(OBJECT *o_current, char *new_attrib_name)
       
       /* may need to check more thoroughly here. . . . */
       old_attrib_text = g_strdup(a_current->object->text->string);
-      old_attrib_name = u_basic_breakup_string(old_attrib_text, '=', 0);
+      o_attrib_get_name_value(old_attrib_text, &old_attrib_name, NULL);
       
       if (strcmp(old_attrib_name, new_attrib_name) == 0) {
 	/* We've found the attrib.  Delete it and then return. */
diff --git a/gattrib/src/s_sheet_data.c b/gattrib/src/s_sheet_data.c
index 9ba33ef..7fcdad9 100644
--- a/gattrib/src/s_sheet_data.c
+++ b/gattrib/src/s_sheet_data.c
@@ -201,7 +201,7 @@ void s_sheet_data_add_master_comp_attrib_list_items(OBJECT *start_obj) {
 	  if (a_current->object->type == OBJ_TEXT 
 	      && a_current->object->text != NULL) {  /* found an attribute */
 	    attrib_text = g_strdup(a_current->object->text->string);
-	    attrib_name = u_basic_breakup_string(attrib_text, '=', 0);
+	    o_attrib_get_name_value(attrib_text, &attrib_name, NULL);
 
 	      /* Don't include "refdes" or "slot" because they form the row name */
 	      /* Also don't include "net" per bug found by Steve W. -- 4.3.2007, SDB */
@@ -408,8 +408,7 @@ void s_sheet_data_add_master_pin_attrib_list_items(OBJECT *start_obj) {
 		if (pin_attrib->object->type == OBJ_TEXT 
 		    && pin_attrib->object->text != NULL) {  /* found an attribute */
 		  attrib_text = g_strdup(pin_attrib->object->text->string);
-		  attrib_name = u_basic_breakup_string(attrib_text, '=', 0);
-		  attrib_value = s_misc_remaining_string(attrib_text, '=', 1);
+		  o_attrib_get_name_value(attrib_text, &attrib_name, &attrib_value);
 		  if ( (strcmp(attrib_name, "pinnumber") != 0) 
 		       && (attrib_value != NULL) ) {  
 		    /* Don't include "pinnumber" because it is already in other master list.
diff --git a/gattrib/src/s_table.c b/gattrib/src/s_table.c
index d89bf68..1807471 100644
--- a/gattrib/src/s_table.c
+++ b/gattrib/src/s_table.c
@@ -284,8 +284,7 @@ void s_table_add_toplevel_comp_items_to_comp_table(OBJECT *start_obj) {
               && a_current->object->text != NULL) {  /* found an attribute */
             /* may need to check more thoroughly here. . . . */
             attrib_text = g_strdup(a_current->object->text->string);
-            attrib_name = u_basic_breakup_string(attrib_text, '=', 0);
-            attrib_value = s_misc_remaining_string(attrib_text, '=', 1);
+            o_attrib_get_name_value(attrib_text, &attrib_name, &attrib_value);
 	    old_visibility = a_current->object->visibility;
 	    old_show_name_value = a_current->object->show_name_value;
 
@@ -368,8 +367,7 @@ void s_table_add_toplevel_net_items_to_net_table(OBJECT *start_obj) {
             && a_current->object->text != NULL) {  /* found an attribute */
           /* may need to check more thoroughly here. . . . */
           attrib_text = g_strdup(a_current->object->text->string);
-          attrib_name = u_basic_breakup_string(attrib_text, '=', 0);
-          attrib_value = s_misc_remaining_string(attrib_text, '=', 1);
+          o_attrib_get_name_value(attrib_text, &attrib_name, &attrib_value);
           if (strcmp(attrib_name, "netname") != 0) {
             /* Don't include "netname" */
              
@@ -480,8 +478,7 @@ void s_table_add_toplevel_pin_items_to_pin_table(OBJECT *start_obj) {
 	      if (pin_attrib->object->type == OBJ_TEXT
 		  && pin_attrib->object->text != NULL) {  /* found an attribute */
 		attrib_text = g_strdup(pin_attrib->object->text->string);
-		attrib_name = u_basic_breakup_string(attrib_text, '=', 0);
-		attrib_value = s_misc_remaining_string(attrib_text, '=', 1);
+		o_attrib_get_name_value(attrib_text, &attrib_name, &attrib_value);
  
 		if ( (strcmp(attrib_name, "pinnumber") != 0) 
 		     && (attrib_value != 0) ) {
diff --git a/gattrib/src/s_toplevel.c b/gattrib/src/s_toplevel.c
index f1e9046..4608d43 100644
--- a/gattrib/src/s_toplevel.c
+++ b/gattrib/src/s_toplevel.c
@@ -630,7 +630,7 @@ void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current,
 
       /* Else clause is suggestion from Ales */
 #if 1
-      old_attrib_name = u_basic_breakup_string(old_name_value_pair, '=', 0);
+      o_attrib_get_name_value(old_name_value_pair, &old_attrib_name, NULL);
       if ( (strcmp(old_attrib_name, "refdes") != 0) &&
 	   (strcmp(old_attrib_name, "net") != 0) &&
 	   (strcmp(old_attrib_name, "slot") != 0) &&
@@ -683,7 +683,7 @@ void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current,
 
   /*  Now get the old attrib name & value from complete_comp_attrib_list 
    *  and value from o_current  */
-  old_attrib_name = u_basic_breakup_string(local_list->data, '=', 0); 
+  o_attrib_get_name_value(local_list->data, &old_attrib_name, NULL);
   old_attrib_value = o_attrib_search_name_single_count(o_current, old_attrib_name, 0);
 
 #if DEBUG
@@ -694,7 +694,7 @@ void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current,
 #endif
 
   /*  Next try to get this attrib from new_comp_attrib_list  */
-  new_attrib_name = u_basic_breakup_string(local_list->data, '=', 0);
+  o_attrib_get_name_value(local_list->data, &new_attrib_name, NULL);
   if (s_string_list_in_list(new_comp_attrib_list, local_list->data)) {
     new_attrib_value = s_misc_remaining_string(local_list->data, '=', 1);      
   } else {
@@ -931,8 +931,7 @@ void s_toplevel_update_pin_attribs_in_toplevel(char *refdes, OBJECT *o_pin,
   printf("        In s_toplevel_update_pin_attribs_in_toplevel, handling entry in master list %s .\n", new_name_value_pair);
 #endif
 
-  new_attrib_name = u_basic_breakup_string(new_name_value_pair, '=', 0);
-  new_attrib_value = u_basic_breakup_string(new_name_value_pair, '=', 1);
+  o_attrib_get_name_value(new_name_value_pair, &new_attrib_name, &new_attrib_value);
 
   if (strlen(new_attrib_value) == 0) {
     g_free(new_attrib_value);   

commit 872287f23b4880b01babed777efe7976783feab2
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:05 2008 +0200

    Cleanup of libgeda o_attrib_get_name_value().
    
    Rewrote o_attrib_get_name_value(): it now has support for UTF-8
    attribute strings ; plus it can return only the name or the value or
    both name and value.
    
    Finally adapted code wherever it can benefits this new feature.

diff --git a/gnetlist/src/vams_misc.c b/gnetlist/src/vams_misc.c
index 9b0d0ed..fb7094c 100644
--- a/gnetlist/src/vams_misc.c
+++ b/gnetlist/src/vams_misc.c
@@ -45,7 +45,6 @@ vams_get_attribs_list(OBJECT *object, SCM *list, OBJECT **return_found)
   OBJECT *found;
   int val;
   char* found_name = NULL;
-  char* found_value = NULL;
 
   o_current = object;
 
@@ -55,14 +54,13 @@ vams_get_attribs_list(OBJECT *object, SCM *list, OBJECT **return_found)
     found = a_current->object;
     if (found != NULL && found->text && found->text->string) {
       val = o_attrib_get_name_value(found->text->string,
-                                    &found_name, &found_value);
+                                    &found_name, NULL);
 
       if (val) {
         *list = scm_cons (scm_makfrom0str (found_name), *list);
       }
 
      g_free(found_name);
-     g_free(found_value);
 #if DEBUG
       printf("0 _%s_\n", found->text->string);
       printf("1 _%s_\n", found_name);
diff --git a/gschem/src/g_hook.c b/gschem/src/g_hook.c
index 303e058..7916120 100644
--- a/gschem/src/g_hook.c
+++ b/gschem/src/g_hook.c
@@ -416,7 +416,7 @@ static void custom_world_get_single_object_bounds
     GList *a_iter;
     int rleft, rright, rbottom, rtop;
     char *text_value; 
-    char *name_ptr, *value_ptr, aux_ptr[2];
+    char *name_ptr, aux_ptr[2];
     gboolean include_text;
 
     *left = rleft = toplevel->init_right;
@@ -437,7 +437,7 @@ static void custom_world_get_single_object_bounds
           case (OBJ_TEXT):
 	    if (obj_ptr->text && obj_ptr->text->string) {
 	      text_value = obj_ptr->text->string;
-	      if (o_attrib_get_name_value(text_value, &name_ptr, &value_ptr) &&
+	      if (o_attrib_get_name_value(text_value, &name_ptr, NULL) &&
 		  g_list_find_custom(exclude_attrib_list, name_ptr, (GCompareFunc) &strcmp)) {
 		include_text = FALSE;
 	      }
@@ -450,7 +450,6 @@ static void custom_world_get_single_object_bounds
 						&rleft, &rtop, &rright, &rbottom);
 	      }
 	      g_free(name_ptr);
-	      g_free(value_ptr);
 	    }
 	    break;
           case (OBJ_COMPLEX):
diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index b548d34..36a8bc0 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -817,17 +817,16 @@ void o_update_component(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
   while (a_iter != NULL) {
     a_current = a_iter->data;
     OBJECT *o_attrib;
-    gchar *name, *value;
+    gchar *name;
     char *attrfound;
     g_assert (a_current->object->type == OBJ_TEXT);
     o_attrib_get_name_value (a_current->object->text->string,
-                             &name, &value);
+                             &name, NULL);
 
     attrfound = o_attrib_search_name_single(o_current, name, NULL);
 
     /* free these now since they are no longer being used */
     g_free(name);
-    g_free(value);
 
     if (attrfound == NULL) {
       /* attribute with same name not found in old component: */
diff --git a/gschem/src/o_slot.c b/gschem/src/o_slot.c
index d8363d7..a47d7c4 100644
--- a/gschem/src/o_slot.c
+++ b/gschem/src/o_slot.c
@@ -113,13 +113,12 @@ void o_slot_end(GSCHEM_TOPLEVEL *w_current, char *string, int len)
   char *slot_value;
   char *numslots_value;
   OBJECT *slot_text_object;
-  char *name = NULL;
   char *value = NULL;
   int numslots;
   int new_slot_number;
   int status;
 
-  status = o_attrib_get_name_value(string, &name, &value);
+  status = o_attrib_get_name_value(string, NULL, &value);
   if (!status) {
     s_log_message(_("Slot attribute malformed\n"));
     return;
@@ -142,7 +141,6 @@ void o_slot_end(GSCHEM_TOPLEVEL *w_current, char *string, int len)
       s_log_message(_("numslots attribute missing\n"));
       s_log_message(
                     _("Slotting not allowed for this component\n"));
-      g_free(name);
       g_free(value);
       return;
     }
@@ -158,7 +156,6 @@ void o_slot_end(GSCHEM_TOPLEVEL *w_current, char *string, int len)
 
     if (new_slot_number > numslots || new_slot_number <=0 ) {
       s_log_message(_("New slot number out of range\n"));
-      g_free(name);
       g_free(value);
       return;
     }
@@ -223,13 +220,11 @@ void o_slot_end(GSCHEM_TOPLEVEL *w_current, char *string, int len)
     o_redraw_single(w_current,object);
 
     toplevel->page_current->CHANGED = 1;
-    g_free(name);
     g_free(value);
 
   } else {
     fprintf(stderr,
             _("uggg! you tried to slot edit something that doesn't exist!\n"));
-    g_free(name);
     g_free(value);
     exit(-1);
   }
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index 180fbbf..c25f468 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -4072,10 +4072,9 @@ x_dialog_close_window (GSCHEM_TOPLEVEL *w_current)
 int x_dialog_validate_attribute(GtkWindow* parent, char *attribute)
 {
   GtkWidget* message_box;
-  char *name_ptr, *value_ptr;
 
   /* validate the new attribute */
-  if (!o_attrib_get_name_value(attribute, &name_ptr, &value_ptr)) {
+  if (!o_attrib_get_name_value(attribute, NULL, NULL)) {
       message_box = gtk_message_dialog_new_with_markup (parent,
                                   GTK_DIALOG_DESTROY_WITH_PARENT,
                                   GTK_MESSAGE_ERROR,
@@ -4087,8 +4086,6 @@ int x_dialog_validate_attribute(GtkWindow* parent, char *attribute)
      gtk_widget_destroy (message_box);
      return FALSE;
   }
-  g_free(name_ptr);
-  g_free(value_ptr);
   return TRUE;
 }
 /***************** End of misc helper dialog boxes **************/
diff --git a/gschem/src/x_multiattrib.c b/gschem/src/x_multiattrib.c
index 4aeebe8..679d428 100644
--- a/gschem/src/x_multiattrib.c
+++ b/gschem/src/x_multiattrib.c
@@ -536,19 +536,18 @@ static void multiattrib_column_set_data_name(GtkTreeViewColumn *tree_column,
 					     gpointer data)
 {
   OBJECT *o_attrib;
-  gchar *name, *value;
+  gchar *name;
 
   gtk_tree_model_get (tree_model, iter,
                       COLUMN_ATTRIBUTE, &o_attrib,
                       -1);
   g_assert (o_attrib->type == OBJ_TEXT);
   
-  o_attrib_get_name_value (o_attrib->text->string, &name, &value);
+  o_attrib_get_name_value (o_attrib->text->string, &name, NULL);
   g_object_set (cell,
                 "text", name,
                 NULL);
   g_free (name);
-  g_free (value);
   
 }
 
@@ -564,18 +563,17 @@ static void multiattrib_column_set_data_value(GtkTreeViewColumn *tree_column,
 					      gpointer data)           
 {
   OBJECT *o_attrib;
-  gchar *name, *value;
+  gchar *value;
 
   gtk_tree_model_get (tree_model, iter,
                       COLUMN_ATTRIBUTE, &o_attrib,
                       -1);
   g_assert (o_attrib->type == OBJ_TEXT);
   
-  o_attrib_get_name_value (o_attrib->text->string, &name, &value);
+  o_attrib_get_name_value (o_attrib->text->string, NULL, &value);
   g_object_set (cell,
                 "text", value,
                 NULL);
-  g_free (name);
   g_free (value);
   
 }
@@ -690,7 +688,7 @@ static void multiattrib_callback_edited_name(GtkCellRendererText *cellrendererte
   GtkTreeIter iter;
   OBJECT *o_attrib;
   GSCHEM_TOPLEVEL *w_current;
-  gchar *name, *value, *newtext;
+  gchar *value, *newtext;
 
   model = gtk_tree_view_get_model (multiattrib->treeview);
   w_current = GSCHEM_DIALOG (multiattrib)->w_current;
@@ -717,11 +715,10 @@ static void multiattrib_callback_edited_name(GtkCellRendererText *cellrendererte
                       -1);
   g_assert (o_attrib->type == OBJ_TEXT);
 
-  o_attrib_get_name_value (o_attrib->text->string, &name, &value);
+  o_attrib_get_name_value (o_attrib->text->string, NULL, &value);
   newtext = g_strdup_printf ("%s=%s", arg2, value);
 
   if (!x_dialog_validate_attribute(GTK_WINDOW(multiattrib), newtext)) {
-    g_free (name);
     g_free (value);
     g_free(newtext);
     return;
@@ -732,7 +729,6 @@ static void multiattrib_callback_edited_name(GtkCellRendererText *cellrendererte
   o_text_change (w_current, o_attrib,
                  newtext, o_attrib->visibility, o_attrib->show_name_value);
 
-  g_free (name);
   g_free (value);
   g_free (newtext);
   
@@ -753,7 +749,7 @@ static void multiattrib_callback_edited_value(GtkCellRendererText *cell_renderer
   GtkTreeIter iter;
   OBJECT *o_attrib;
   GSCHEM_TOPLEVEL *w_current;
-  gchar *name, *value, *newtext;
+  gchar *name, *newtext;
 
   model = gtk_tree_view_get_model (multiattrib->treeview);
   w_current = GSCHEM_DIALOG (multiattrib)->w_current;
@@ -767,12 +763,11 @@ static void multiattrib_callback_edited_value(GtkCellRendererText *cell_renderer
                       -1);
   g_assert (o_attrib->type == OBJ_TEXT);
 
-  o_attrib_get_name_value (o_attrib->text->string, &name, &value);
+  o_attrib_get_name_value (o_attrib->text->string, &name, NULL);
   newtext = g_strdup_printf ("%s=%s", name, arg2);
 
   if (!x_dialog_validate_attribute(GTK_WINDOW(multiattrib), newtext)) {
     g_free (name);
-    g_free (value);
     g_free(newtext);
     return;
   }
@@ -785,7 +780,6 @@ static void multiattrib_callback_edited_value(GtkCellRendererText *cell_renderer
   update_row_display (model, &iter);
   
   g_free (name);
-  g_free (value);
   g_free (newtext);
   
 }
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index f1c08d3..82e69d8 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -106,7 +106,7 @@ void o_attrib_attach(TOPLEVEL *toplevel, OBJECT *parent_list, OBJECT *text_objec
 void o_attrib_free_all(TOPLEVEL *toplevel, GList *list);
 void o_attrib_print(GList *attributes);
 void o_attrib_remove(GList **list, OBJECT *remove);
-int o_attrib_get_name_value(char *string, char **name, char **value);
+gboolean o_attrib_get_name_value (const gchar *string, gchar **name_ptr, gchar **value_ptr);
 void o_attrib_free_current(TOPLEVEL *toplevel);
 void o_attrib_set_string(TOPLEVEL *toplevel, char *string);
 void o_attrib_set_color(TOPLEVEL *toplevel, GList *attributes);
diff --git a/libgeda/src/g_smob.c b/libgeda/src/g_smob.c
index ca2527e..fc1b0c9 100644
--- a/libgeda/src/g_smob.c
+++ b/libgeda/src/g_smob.c
@@ -164,7 +164,6 @@ SCM g_set_attrib_value_internal(SCM attrib_smob, SCM scm_value,
   struct st_attrib_smob *attribute;
   char *name = NULL;
   char *value = NULL;
-  char *old_value = NULL;
 
   SCM_ASSERT ( SCM_NIMP(attrib_smob) && 
                ((long) SCM_CAR(attrib_smob) == attrib_smob_tag),
@@ -182,7 +181,7 @@ SCM g_set_attrib_value_internal(SCM attrib_smob, SCM scm_value,
       attribute->attribute->object->text->string ) {
 
     o_attrib_get_name_value(attribute->attribute->object->text->string, 
-                            &name, &old_value );
+                            &name, NULL);
 
     *new_string = g_strconcat (name, "=", value, NULL);
 		
@@ -190,7 +189,6 @@ SCM g_set_attrib_value_internal(SCM attrib_smob, SCM scm_value,
     *o_attrib = attribute->attribute->object;
 
     g_free(name);
-    g_free(old_value);
   }
 
   return SCM_UNDEFINED;
diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index eb29775..962789c 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -571,79 +571,52 @@ gchar *o_save_attribs(GList *attribs)
   return g_string_free(acc, FALSE);
 }
 
-/*! \brief Get name and value from name=value attribute.
+/*! \brief Get name and value from an attribute 'name=value' string.
  *  \par Function Description
- *  Get name and value from a name=value attribute.
+ *  This function parses the character string \a string expected to be
+ *  an attribute string of the form 'name=value'.
  *
- *  \param [in]  string     String to split into name/value pair.
- *  \param [out] name_ptr   Name if found in string, NULL otherwise.
- *  \param [out] value_ptr  Value if found in string, NULL otherwise.
- *  \return TRUE if string had equals in it, FALSE otherwise.
+ *  It returns TRUE if it has been able to parse the string into the
+ *  name and value parts of an attribute. Otherwise it returns FALSE,
+ *  in that case \a *name_ptr and \a *value_ptr are unset.
  *
- *  \note
- *  both name and value must be pre allocated
- *  And if you get an invalid attribute (improper) with a name and no
- *  value, then it is NOT an attribute.
- *  Also, there cannot be any spaces beside the equals sign
- *  Changed: now it allocates memory for name and value strings.
- *  \warning
- *  Caller must g_free these strings when not needed.
+ *  \a name_ptr and/or \a value_ptr can be NULL.
+ *
+ *  \param [in]  string     String to split into name/value pair.
+ *  \param [out] name_ptr   The return location for the name, or NULL.
+ *  \param [out] value_ptr  The return location for the value, or NULL.
+ *  \return TRUE on success, FALSE otherwise.
  */
-int o_attrib_get_name_value(char *string, char **name_ptr, char **value_ptr )
+gboolean
+o_attrib_get_name_value (const gchar *string, gchar **name_ptr, gchar **value_ptr)
 {
-  char *equal_ptr;
-  char **str_array;
+  gchar *ptr, *prev_char, *next_char;
+  
+  g_return_val_if_fail (string != NULL, FALSE);
 
-  if (name_ptr == NULL || value_ptr == NULL) {
-    return(FALSE);
+  ptr = g_utf8_strchr (string, -1, g_utf8_get_char ("="));
+  if (ptr == NULL) {
+    return FALSE;
   }
 
-  *name_ptr = NULL;  /* force these values to null */
-  *value_ptr = NULL;
-
-  if (!string) {
-    return(FALSE);
+  prev_char = g_utf8_find_prev_char (string, ptr);
+  next_char = g_utf8_find_next_char (ptr, NULL);
+  if ((prev_char == NULL) ||
+      g_unichar_isspace (g_utf8_get_char (prev_char)) ||
+      ((next_char != NULL) &&
+       g_unichar_isspace (g_utf8_get_char (next_char)))) {
+    return FALSE;
   }
 
-  /* make sure there are no spaces in between equals */
-  equal_ptr = strchr(string, '=');
-  if (equal_ptr == NULL) {
-    return(FALSE);
+  if (name_ptr != NULL) {
+    *name_ptr = g_strndup (string, (ptr - string));
   }
 
-
-  /*! \todo Technically this isn't a correct if statement.  This if will 
-   * cause an invalid read for strings:  =name and value= 
-   */
-  if ( (*(equal_ptr + 1) == ' ') || (*(equal_ptr - 1) == ' ') ) {
-     /* sometimes you have text with an ='s in it, it shouldn't be */
-     /* treated like an attribute */
-
-#if DEBUG 
-    s_log_message("Found attrib/text with spaces beside the ='s [%s]\n", 
-	          string);
-    s_log_message("You can ignore the above message if the text is not intended to be an attribute\n");
-#endif
-
-    return(FALSE);
+  if (value_ptr != NULL) {
+    *value_ptr = g_strdup (next_char != NULL ? next_char : "");
   }
 
-  str_array = g_strsplit (string, "=", 2);
-  
-  *name_ptr = g_strdup(str_array[0]);
-  *value_ptr = g_strdup(str_array[1]);
-  g_strfreev(str_array);
-  
-  if (*value_ptr && (*value_ptr)[0] == '\0') {
-    s_log_message(_("Found an improper attribute: _%s_\n"), string);
-#if 0 /* for now leak this memory till this is verified correct everywhere */
-    g_free(*name_ptr); *name_ptr = NULL;
-    g_free(*value_ptr); *value_ptr = NULL;
-#endif
-    return(FALSE);
-  } else {
-    return(TRUE);
-  }
+  return TRUE;
 }
 
 /*! \brief Free the currently selected attribute.
@@ -934,7 +907,6 @@ char *o_attrib_search_string_partial(OBJECT *object, char *search_for,
   OBJECT *o_current;
   int val;
   int internal_counter=0;
-  char *found_name = NULL;
   char *found_value = NULL;
   char *return_string = NULL;
 
@@ -950,10 +922,9 @@ char *o_attrib_search_string_partial(OBJECT *object, char *search_for,
         internal_counter++;	
       } else {
         val = o_attrib_get_name_value(o_current->text->string, 
-                                      &found_name, &found_value);
+                                      NULL, &found_value);
         if (val) {
           return_string = g_strdup(found_value);
-	  g_free(found_name);
 	  g_free(found_value);
 	  return(return_string);
         }
@@ -961,7 +932,6 @@ char *o_attrib_search_string_partial(OBJECT *object, char *search_for,
     }
   }	
 	
-  g_free(found_name);
   g_free(found_value);
   return (NULL);
 } 
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 03cd837..0b8bddb 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -231,7 +231,6 @@ int o_complex_is_eligible_attribute (TOPLEVEL *toplevel, OBJECT *object,
 				     int promote_invisible) 
 {
   char *name = NULL;
-  char *value = NULL;
   char *padded_name = NULL;
   int promotableAttribute = FALSE;
   char *ptr;
@@ -260,7 +259,7 @@ int o_complex_is_eligible_attribute (TOPLEVEL *toplevel, OBJECT *object,
   if (toplevel->always_promote_attributes &&
       (strlen(toplevel->always_promote_attributes) != 0))
   {
-    if (o_attrib_get_name_value(object->text->string, &name, &value))
+    if (o_attrib_get_name_value(object->text->string, &name, NULL))
     {
       padded_name = g_strdup_printf(" %s ", name);
       if (strstr(toplevel->always_promote_attributes, padded_name))
@@ -272,7 +271,6 @@ int o_complex_is_eligible_attribute (TOPLEVEL *toplevel, OBJECT *object,
       
       g_free(padded_name);
       g_free(name);
-      g_free(value);
       if (promotableAttribute)
 	return TRUE;
     }

commit 9014bf8d0a429713b642912cddcc29e1c39b9068
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:04 2008 +0200

    Remove unused function u_basic_count_char().

diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 7713344..f1c08d3 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -507,4 +507,3 @@ void s_undo_free_all(TOPLEVEL *toplevel, PAGE *p_current);
 
 /* u_basic.c */
 char *u_basic_breakup_string(char *string, char delimiter, int count);
-int u_basic_count_char(const char *string, char character);
diff --git a/libgeda/src/u_basic.c b/libgeda/src/u_basic.c
index fb67399..bfb9948 100644
--- a/libgeda/src/u_basic.c
+++ b/libgeda/src/u_basic.c
@@ -98,37 +98,3 @@ char *u_basic_breakup_string(char *string, char delimiter, int count)
   return_value[j] = '\0';
   return(return_value);
 }
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-/*
- * This fcn counts the number of occurances of the character
- * "character" in the string "string".
- * 1.23.2005 -- SDB
- */
-int u_basic_count_char(const char *string, char character)
-{
-  int count = 0;
-  int i=0;
-
-#ifdef DEBUG
-  printf("In u_basic_count_char, looking for char \"%c\" in string \"%s\".\n", 
-	  character, string);
-#endif
-
-  while (string[i] != '\0') {
-    if (string[i] == character) {
-      count++;
-    }
-  i++;
-  }
-#ifdef DEBUG
-  printf(". . . . .   Found it %d times.\n", 
-	  count);
-#endif
-
-return count;
-}

commit 5d97c15d614030eb32ddc30e316fadd4d1416c6c
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:03 2008 +0200

    Fix memory leak in gschem.
    
    When processing file names passed on command line, the pathname built
    for each one was not freed.

diff --git a/gschem/src/gschem.c b/gschem/src/gschem.c
index 7958d23..d350903 100644
--- a/gschem/src/gschem.c
+++ b/gschem/src/gschem.c
@@ -287,7 +287,7 @@ void main_prog(void *closure, int argc, char *argv[])
      * f_open (called by x_window_open_page). This works for Linux and MINGW32.
      */
     x_window_open_page(w_current, filename);
-
+    g_free (filename);
   }
 
   g_free(cwd);

commit 25a40b882113ba6b710b58ad85e7cf7804d3a4ac
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:02 2008 +0200

    Remove unused functions u_basic_strip_trailing() and u_basic_has_trailing().

diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index eabf6bb..7713344 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -507,6 +507,4 @@ void s_undo_free_all(TOPLEVEL *toplevel, PAGE *p_current);
 
 /* u_basic.c */
 char *u_basic_breakup_string(char *string, char delimiter, int count);
-void u_basic_strip_trailing(char *string, char c);
-int u_basic_has_trailing(char *string, char c);
 int u_basic_count_char(const char *string, char character);
diff --git a/libgeda/src/u_basic.c b/libgeda/src/u_basic.c
index 7b2ed4b..fb67399 100644
--- a/libgeda/src/u_basic.c
+++ b/libgeda/src/u_basic.c
@@ -104,37 +104,6 @@ char *u_basic_breakup_string(char *string, char delimiter, int count)
  *  \par Function Description
  *
  */
-void u_basic_strip_trailing(char *string, char c)
-{
-  if (string) {
-   int len = strlen(string) - 1; /* point to last char */
-   if (string[len] == c) {
-       string[len] = '\0';
-    }
-  }
-}
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-int u_basic_has_trailing(char *string, char c)
-{
-  if (string) {
-   int len = strlen(string) - 1; /* point to last char */
-   if (string[len] == c) {
-	return TRUE;
-    }
-  }
-  return FALSE;
-}
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
 /*
  * This fcn counts the number of occurances of the character
  * "character" in the string "string".

commit a76cf5cdda91c7070f4765107d3f8be89bbd05b6
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:01 2008 +0200

    Remove unnecessary strippings of trailing directory separator.
    
    These strippings is no more necessary as GLib functions for building
    filenames (in particular g_build_filename()) takes care of any
    trailing directory separator for us.

diff --git a/gnetlist/src/gnetlist.c b/gnetlist/src/gnetlist.c
index 3e98772..957d0f6 100644
--- a/gnetlist/src/gnetlist.c
+++ b/gnetlist/src/gnetlist.c
@@ -122,9 +122,6 @@ void main_prog(void *closure, int argc, char *argv[])
 
     argv_index = parse_commandline(argc, argv);
     cwd = g_get_current_dir();
-#ifdef __MINGW32__
-    u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
-#endif
 
     /* this is a kludge to make sure that spice mode gets set */
     /*  Hacked by SDB to allow spice netlisters of arbitrary name
diff --git a/gschem/src/gschem.c b/gschem/src/gschem.c
index feb447d..7958d23 100644
--- a/gschem/src/gschem.c
+++ b/gschem/src/gschem.c
@@ -168,9 +168,6 @@ void main_prog(void *closure, int argc, char *argv[])
 
   argv_index = parse_commandline(argc, argv);
   cwd = g_get_current_dir();
-#ifdef __MINGW32__
-    u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
-#endif
   
   libgeda_init();
   
diff --git a/gsymcheck/src/gsymcheck.c b/gsymcheck/src/gsymcheck.c
index 3742b0a..6861115 100644
--- a/gsymcheck/src/gsymcheck.c
+++ b/gsymcheck/src/gsymcheck.c
@@ -58,9 +58,6 @@ main_prog(void *closure, int argc, char *argv[])
   
   argv_index = parse_commandline(argc, argv);
   cwd = g_get_current_dir();
-#ifdef __MINGW32__
-  u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
-#endif
 
   libgeda_init();
 
diff --git a/libgeda/src/g_rc.c b/libgeda/src/g_rc.c
index 97e2f12..7124d20 100644
--- a/libgeda/src/g_rc.c
+++ b/libgeda/src/g_rc.c
@@ -425,9 +425,6 @@ SCM g_rc_component_library(SCM path, SCM name)
   } else {
     gchar *cwd = g_get_current_dir ();
     gchar *temp;
-#ifdef __MINGW32__
-    u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
-#endif
     temp = g_build_filename (cwd, string, NULL);
     s_clib_add_directory (temp, namestr);
     g_free(temp);
@@ -571,9 +568,6 @@ SCM g_rc_component_library_search(SCM path)
         } else {
           gchar *cwd = g_get_current_dir ();
           gchar *temp;
-#ifdef __MINGW32__
-          u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
-#endif
           temp = g_build_filename (cwd, fullpath, NULL);
           s_clib_add_directory (temp, NULL);
           g_free(temp);
@@ -620,9 +614,6 @@ SCM g_rc_source_library(SCM path)
   } else {
     gchar *cwd = g_get_current_dir ();
     gchar *temp;
-#ifdef __MINGW32__
-    u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
-#endif
     temp = g_build_filename (cwd, string, NULL);
     s_slib_add_entry (temp);
     g_free(temp);
@@ -686,9 +677,6 @@ SCM g_rc_source_library_search(SCM path)
           } else {
             gchar *cwd = g_get_current_dir ();
             gchar *temp;
-#ifdef __MINGW32__
-            u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
-#endif
             temp = g_build_filename (cwd, fullpath, NULL);
             s_slib_add_entry (temp);
             g_free(temp);
diff --git a/utils/gschlas/gschlas.c b/utils/gschlas/gschlas.c
index 701783c..53d7ae0 100644
--- a/utils/gschlas/gschlas.c
+++ b/utils/gschlas/gschlas.c
@@ -60,9 +60,6 @@ main_prog(void *closure, int argc, char *argv[])
 
   argv_index = parse_commandline(argc, argv);
   cwd = g_get_current_dir();
-#ifdef __MINGW32__
-  u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
-#endif
 
   libgeda_init();
 

commit cd70e88b8c7faa4beea8b13b846e92807a252e63
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:03:00 2008 +0200

    Replace getcwd() with g_get_current_dir().

diff --git a/gnetlist/src/gnetlist.c b/gnetlist/src/gnetlist.c
index 6a717a1..3e98772 100644
--- a/gnetlist/src/gnetlist.c
+++ b/gnetlist/src/gnetlist.c
@@ -121,7 +121,7 @@ void main_prog(void *closure, int argc, char *argv[])
     output_filename = g_strdup("output.net");
 
     argv_index = parse_commandline(argc, argv);
-    cwd = getcwd(NULL, MAXPATHLEN);
+    cwd = g_get_current_dir();
 #ifdef __MINGW32__
     u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
 #endif
@@ -313,7 +313,7 @@ void main_prog(void *closure, int argc, char *argv[])
     /* Change back to the directory where we started AGAIN.  This is done */
     /* because the s_traverse functions can change the Current Working Directory. */
     chdir(cwd);
-    free(cwd); /* allocated by getcwd, so this should stay as free() */
+    g_free(cwd);
 
     /* temporarly reuse input_str */
     sprintf(input_str, "%s%cgnetlist-post.scm", pr_current->scheme_directory,
diff --git a/gschem/src/gschem.c b/gschem/src/gschem.c
index f142c75..feb447d 100644
--- a/gschem/src/gschem.c
+++ b/gschem/src/gschem.c
@@ -167,7 +167,7 @@ void main_prog(void *closure, int argc, char *argv[])
   gtk_init(&argc, &argv);
 
   argv_index = parse_commandline(argc, argv);
-  cwd = getcwd(NULL, 1024);
+  cwd = g_get_current_dir();
 #ifdef __MINGW32__
     u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
 #endif
@@ -293,7 +293,7 @@ void main_prog(void *closure, int argc, char *argv[])
 
   }
 
-  free(cwd); /* allocated from getcwd, should be regular free */
+  g_free(cwd);
 
   /* If no page has been loaded (wasn't specified in the command line.) */
   /* Then create an untitled page */
diff --git a/gsymcheck/src/gsymcheck.c b/gsymcheck/src/gsymcheck.c
index 6553e3a..3742b0a 100644
--- a/gsymcheck/src/gsymcheck.c
+++ b/gsymcheck/src/gsymcheck.c
@@ -57,7 +57,7 @@ main_prog(void *closure, int argc, char *argv[])
   TOPLEVEL *pr_current;
   
   argv_index = parse_commandline(argc, argv);
-  cwd = getcwd(NULL, 1024);
+  cwd = g_get_current_dir();
 #ifdef __MINGW32__
   u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
 #endif
@@ -135,7 +135,7 @@ main_prog(void *closure, int argc, char *argv[])
     usage(argv[0]);
   }
 
-  free(cwd); /* allocated with getcwd, should stay as free */
+  g_free(cwd);
 
   logging_dest=STDOUT_TTY;
 
diff --git a/libgeda/src/f_basic.c b/libgeda/src/f_basic.c
index c5222ae..ab9013c 100644
--- a/libgeda/src/f_basic.c
+++ b/libgeda/src/f_basic.c
@@ -200,7 +200,7 @@ int f_open_flags(TOPLEVEL *toplevel, const gchar *filename,
   /* Cache the cwd so we can restore it later. */
   /*! \bug Assumes cwd will be less than 1024 characters. */
   if (flags & F_OPEN_RESTORE_CWD) {
-    saved_cwd = getcwd(NULL, 1024);
+    saved_cwd = g_get_current_dir();
   }
 
   /* get full, absolute path to file */
diff --git a/utils/gschlas/gschlas.c b/utils/gschlas/gschlas.c
index d809cf8..701783c 100644
--- a/utils/gschlas/gschlas.c
+++ b/utils/gschlas/gschlas.c
@@ -59,7 +59,7 @@ main_prog(void *closure, int argc, char *argv[])
   TOPLEVEL *pr_current;
 
   argv_index = parse_commandline(argc, argv);
-  cwd = getcwd(NULL, 1024);
+  cwd = g_get_current_dir();
 #ifdef __MINGW32__
   u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
 #endif
@@ -134,7 +134,7 @@ main_prog(void *closure, int argc, char *argv[])
     usage(argv[0]);
   }
 
-  free(cwd); /* allocated by getcwd, should stay as free */
+  g_free(cwd);
 
   logging_dest=STDOUT_TTY;
 

commit 90b0ece453efc80490c6c277386f4f5f7bfdc4af
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:59 2008 +0200

    Simplify build of filenames with g_build_filename() (!).
    
    Modified code where possible to use preferably g_build_filename()
    instead of g_build_path(), or g_strconcat() and friends.

diff --git a/gattrib/src/gattrib.c b/gattrib/src/gattrib.c
index 60b6401..596db91 100644
--- a/gattrib/src/gattrib.c
+++ b/gattrib/src/gattrib.c
@@ -140,10 +140,7 @@ void gattrib_main(void *closure, int argc, char *argv[])
   /* ----------  create log file right away ---------- */
   /* ----------  even if logging is enabled ---------- */
   cwd = g_get_current_dir();
-  logfile = g_build_path (G_DIR_SEPARATOR_S,
-                          cwd,
-                          "gattrib.log",
-                          NULL);
+  logfile = g_build_filename (cwd, "gattrib.log", NULL);
   s_log_init (logfile);
   g_free (logfile);
   g_free (cwd);
diff --git a/gnetlist/src/gnetlist.c b/gnetlist/src/gnetlist.c
index fa4f628..6a717a1 100644
--- a/gnetlist/src/gnetlist.c
+++ b/gnetlist/src/gnetlist.c
@@ -145,10 +145,7 @@ void main_prog(void *closure, int argc, char *argv[])
 
     /* create log file right away */
     /* even if logging is enabled */
-    logfile = g_build_path (G_DIR_SEPARATOR_S,
-                            cwd,
-                            "gnetlist.log",
-                            NULL);
+    logfile = g_build_filename (cwd, "gnetlist.log", NULL);
     s_log_init (logfile);
     g_free (logfile);
 
@@ -228,7 +225,7 @@ void main_prog(void *closure, int argc, char *argv[])
         /* Path is already absolute so no need to do any concat of cwd */
         filename = g_strdup (argv[i]);
       } else {
-        filename = g_build_path (G_DIR_SEPARATOR_S, cwd, argv[i], NULL);
+        filename = g_build_filename (cwd, argv[i], NULL);
       }
 
       if (!quiet_mode) {
diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index 190d950..ccbe19a 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -59,19 +59,13 @@ void g_rc_parse_gtkrc()
   gchar *filename;
   const gchar *home;
 
-  filename = g_strconcat (g_rc_parse_path (),
-                          G_DIR_SEPARATOR_S,
-                          "gschem-gtkrc",
-                          NULL);
+  filename = g_build_filename (g_rc_parse_path (), "gschem-gtkrc", NULL);
   gtk_rc_parse (filename);
   g_free (filename);
   
   home = g_getenv ("HOME");
   if (home != NULL) {
-    filename = g_strconcat (home,
-                            G_DIR_SEPARATOR_S,
-                            ".gschem-gtkrc",
-                            NULL);
+    filename = g_build_filename (home, ".gschem-gtkrc", NULL);
     gtk_rc_parse (filename);
     g_free (filename);
   }
diff --git a/gschem/src/gschem.c b/gschem/src/gschem.c
index 4e2e632..f142c75 100644
--- a/gschem/src/gschem.c
+++ b/gschem/src/gschem.c
@@ -176,10 +176,7 @@ void main_prog(void *closure, int argc, char *argv[])
   
   /*! \todo Probably the file name shuold be defined elsewhere */
   /* create log file right away even if logging is enabled */
-  filename = g_build_path (G_DIR_SEPARATOR_S,
-                           cwd,
-                           "gschem.log",
-                           NULL);
+  filename = g_build_filename (cwd, "gschem.log", NULL);
   s_log_init (filename);
   g_free (filename);
 
@@ -241,8 +238,7 @@ void main_prog(void *closure, int argc, char *argv[])
   g_rc_parse_gtkrc();
   g_rc_parse(w_current->toplevel, "gschemrc", rc_filename);
   
-  input_str = g_strdup_printf("%s%cgschem.scm", default_scheme_directory, 
-			      G_DIR_SEPARATOR);
+  input_str = g_build_filename (default_scheme_directory, "gschem.scm", NULL);
   if (g_read_file(input_str) != -1) {
     s_log_message(_("Read init scm file [%s]\n"), input_str);
   } else {
@@ -282,7 +278,7 @@ void main_prog(void *closure, int argc, char *argv[])
       /* Path is already absolute so no need to do any concat of cwd */
       filename = g_strdup (argv[i]);
     } else {
-      filename = g_strconcat (cwd, G_DIR_SEPARATOR_S, argv[i], NULL);
+      filename = g_build_filename (cwd, argv[i], NULL);
     }
 
     if ( first_page )
diff --git a/gschem/src/x_autonumber.c b/gschem/src/x_autonumber.c
index 017af04..b58b3f5 100644
--- a/gschem/src/x_autonumber.c
+++ b/gschem/src/x_autonumber.c
@@ -881,8 +881,8 @@ void autonumber_sortorder_create(GSCHEM_TOPLEVEL *w_current, GtkWidget *sort_ord
   store = gtk_list_store_new(2, G_TYPE_STRING, GDK_TYPE_PIXBUF); 
 
   for (i=0; filenames[i] != NULL; i++) {
-    path=g_strconcat(w_current->toplevel->bitmap_directory,
-		     G_DIR_SEPARATOR_S, filenames[i], NULL);
+    path=g_build_filename(w_current->toplevel->bitmap_directory,
+		     filenames[i], NULL);
     pixbuf = gdk_pixbuf_new_from_file(path, &error);
     g_free(path);
     gtk_list_store_append(store, &iter);
diff --git a/gsymcheck/src/gsymcheck.c b/gsymcheck/src/gsymcheck.c
index 7ddc4e2..6553e3a 100644
--- a/gsymcheck/src/gsymcheck.c
+++ b/gsymcheck/src/gsymcheck.c
@@ -66,10 +66,7 @@ main_prog(void *closure, int argc, char *argv[])
 
   /* create log file right away */
   /* even if logging is enabled */
-  logfile = g_build_path (G_DIR_SEPARATOR_S,
-                          cwd,
-                          "gsymcheck.log",
-                          NULL);
+  logfile = g_build_filename (cwd, "gsymcheck.log", NULL);
   s_log_init (logfile);
   g_free (logfile);
 	
@@ -112,7 +109,7 @@ main_prog(void *closure, int argc, char *argv[])
       /* Path is already absolute so no need to do any concat of cwd */
       filename = g_strdup (argv[i]);
     } else {
-      filename = g_build_path (G_DIR_SEPARATOR_S, cwd, argv[i], NULL);
+      filename = g_build_filename (cwd, argv[i], NULL);
     }
 
     s_page_goto (pr_current,
diff --git a/libgeda/src/f_basic.c b/libgeda/src/f_basic.c
index cfb052f..c5222ae 100644
--- a/libgeda/src/f_basic.c
+++ b/libgeda/src/f_basic.c
@@ -227,10 +227,7 @@ int f_open_flags(TOPLEVEL *toplevel, const gchar *filename,
 
   /* Now open RC and process file */
   if (flags & F_OPEN_RC) {
-    full_rcfilename = g_strconcat (file_directory,  
-                                   G_DIR_SEPARATOR_S, 
-                                   "gafrc",
-                                   NULL);
+    full_rcfilename = g_build_filename (file_directory, "gafrc", NULL);
     g_rc_parse_specified_rc(toplevel, full_rcfilename);
   }
 
diff --git a/libgeda/src/g_rc.c b/libgeda/src/g_rc.c
index 952397f..97e2f12 100644
--- a/libgeda/src/g_rc.c
+++ b/libgeda/src/g_rc.c
@@ -242,12 +242,7 @@ gint g_rc_parse_home_rc(TOPLEVEL *toplevel, const gchar *rcname)
     return 0;
   }
 
-  tmp = g_strconcat (home,
-                     G_DIR_SEPARATOR_S,
-                     ".gEDA",
-                     G_DIR_SEPARATOR_S,
-                     rcname,
-                     NULL);
+  tmp = g_build_filename (home, ".gEDA", rcname, NULL);
   filename = f_normalize_filename (tmp, NULL);
   if (filename == NULL) {
     return 0;
@@ -278,13 +273,11 @@ gint g_rc_parse_home_rc(TOPLEVEL *toplevel, const gchar *rcname)
 gint g_rc_parse_local_rc(TOPLEVEL *toplevel, const gchar *rcname)
 {
   gint found_rc;
-  gchar *tmp;
   char *filename;
   gchar *ok_msg;
   gchar *err_msg;
 
-  tmp = g_strconcat (".", G_DIR_SEPARATOR_S, rcname, NULL);
-  filename = f_normalize_filename (tmp, NULL);
+  filename = f_normalize_filename (rcname, NULL);
   if (filename == NULL) {
     return 0;
   }
@@ -297,7 +290,6 @@ gint g_rc_parse_local_rc(TOPLEVEL *toplevel, const gchar *rcname)
 
   g_free(ok_msg);
   g_free(err_msg);
-  g_free(tmp);
   g_free(filename);
 
   return found_rc;
@@ -436,7 +428,7 @@ SCM g_rc_component_library(SCM path, SCM name)
 #ifdef __MINGW32__
     u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
 #endif
-    temp = g_strconcat (cwd, G_DIR_SEPARATOR_S, string, NULL);
+    temp = g_build_filename (cwd, string, NULL);
     s_clib_add_directory (temp, namestr);
     g_free(temp);
     g_free(cwd);
@@ -571,10 +563,7 @@ SCM g_rc_component_library_search(SCM path)
         (g_strcasecmp (entry, "..")   != 0) &&
         (g_strcasecmp (entry, "font") != 0))
     {
-      gchar *fullpath = g_strconcat (string,
-                                     G_DIR_SEPARATOR_S,
-                                     entry,
-                                     NULL);
+      gchar *fullpath = g_build_filename (string, entry, NULL);
 
       if (g_file_test (fullpath, G_FILE_TEST_IS_DIR)) {
         if (g_path_is_absolute (fullpath)) {
@@ -585,10 +574,7 @@ SCM g_rc_component_library_search(SCM path)
 #ifdef __MINGW32__
           u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
 #endif
-          temp = g_strconcat (cwd,
-                              G_DIR_SEPARATOR_S,
-                              fullpath,
-                              NULL);
+          temp = g_build_filename (cwd, fullpath, NULL);
           s_clib_add_directory (temp, NULL);
           g_free(temp);
           g_free(cwd);
@@ -637,10 +623,7 @@ SCM g_rc_source_library(SCM path)
 #ifdef __MINGW32__
     u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
 #endif
-    temp = g_strconcat (cwd,
-                        G_DIR_SEPARATOR_S,
-                        string,
-                        NULL);
+    temp = g_build_filename (cwd, string, NULL);
     s_slib_add_entry (temp);
     g_free(temp);
     g_free(cwd);
@@ -694,10 +677,7 @@ SCM g_rc_source_library_search(SCM path)
         (g_strcasecmp (entry, "..")   != 0) &&
         (g_strcasecmp (entry, "font") != 0))
     {
-      gchar *fullpath = g_strconcat (string,
-                                     G_DIR_SEPARATOR_S,
-                                     entry,
-                                     NULL);
+      gchar *fullpath = g_build_filename (string, entry, NULL);
 
       if (g_file_test (fullpath, G_FILE_TEST_IS_DIR)) {
         if (s_slib_uniq (fullpath)) {
@@ -709,10 +689,7 @@ SCM g_rc_source_library_search(SCM path)
 #ifdef __MINGW32__
             u_basic_strip_trailing(cwd, G_DIR_SEPARATOR);
 #endif
-            temp = g_strconcat (cwd,
-                                G_DIR_SEPARATOR_S,
-                                fullpath,
-                                NULL);
+            temp = g_build_filename (cwd, fullpath, NULL);
             s_slib_add_entry (temp);
             g_free(temp);
             g_free(cwd);
diff --git a/libgeda/src/o_picture.c b/libgeda/src/o_picture.c
index 9ce2595..acc9b0c 100644
--- a/libgeda/src/o_picture.c
+++ b/libgeda/src/o_picture.c
@@ -198,8 +198,8 @@ OBJECT *o_picture_read(TOPLEVEL *toplevel, OBJECT *object_list,
 
     s_log_message (_("Loading warning picture.\n"));
     
-    temp_filename = g_strconcat(toplevel->bitmap_directory,
-                                G_DIR_SEPARATOR_S, "gschem-warning.png", NULL);
+    temp_filename = g_build_filename (toplevel->bitmap_directory,
+                                      "gschem-warning.png", NULL);
     pixbuf = gdk_pixbuf_new_from_file (temp_filename, NULL);
     if (pixbuf == NULL) {
       s_log_message( _("Error loading picture from file: %s.\n"),
diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index f896400..b4ac53d 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -181,7 +181,7 @@ OBJECT *o_text_load_font(TOPLEVEL *toplevel, gunichar needed_char)
     s_log_message(_("Could not find character '%s' definition.\n"), outbuf);
     
     g_free (temp_string);
-    temp_string = g_strdup_printf("%s%cquest.sym", toplevel->font_directory, G_DIR_SEPARATOR);
+    temp_string = g_build_filename (toplevel->font_directory, "quest.sym", NULL);
     if ( access(temp_string, R_OK) != 0 ) {
       fprintf(stderr, _("Could not load question font char -- check font-directory keyword\n"));
       exit(-1);
diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
index 3543047..cdae0a0 100644
--- a/libgeda/src/s_page.c
+++ b/libgeda/src/s_page.c
@@ -67,10 +67,7 @@ PAGE *s_page_new (TOPLEVEL *toplevel, const gchar *filename)
     page->page_filename = g_strdup (filename);
   } else {
     gchar *pwd = g_get_current_dir ();
-    page->page_filename = g_strconcat (pwd,
-                                       G_DIR_SEPARATOR_S,
-                                       filename,
-                                       NULL);
+    page->page_filename = g_build_filename (pwd, filename, NULL);
     g_free (pwd);
   }
 	
diff --git a/utils/gschlas/gschlas.c b/utils/gschlas/gschlas.c
index 6b553ac..d809cf8 100644
--- a/utils/gschlas/gschlas.c
+++ b/utils/gschlas/gschlas.c
@@ -68,10 +68,7 @@ main_prog(void *closure, int argc, char *argv[])
 
   /* create log file right away */
   /* even if logging is enabled */
-  logfile = g_build_path (G_DIR_SEPARATOR_S,
-                          cwd,
-                          "gschlas.log",
-                          NULL);
+  logfile = g_build_filename (cwd, "gschlas.log", NULL);
   s_log_init (logfile);
   g_free (logfile);
 	
@@ -113,7 +110,7 @@ main_prog(void *closure, int argc, char *argv[])
       /* Path is already absolute so no need to do any concat of cwd */
       filename = g_strdup (argv[i]);
     } else {
-      filename = g_build_path (G_DIR_SEPARATOR_S, cwd, argv[i], NULL);
+      filename = g_build_filename (cwd, argv[i], NULL);
     }
 
     if (!f_open (pr_current,

commit 19d6d561eb5aea8e580d6ecf72d20bdfc3180ace
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:58 2008 +0200

    Remove unnecessary check following memory allocation with GLib g_malloc().
    
    There is no need to check g_malloc() returned value as when the
    function fails to allocate memory, it terminates the application.

diff --git a/gattrib/src/x_gtksheet.c b/gattrib/src/x_gtksheet.c
index 4f9ca8c..275fa62 100644
--- a/gattrib/src/x_gtksheet.c
+++ b/gattrib/src/x_gtksheet.c
@@ -323,10 +323,6 @@ void x_gtksheet_set_cell_text_color(GtkSheet *sheet, gint row, gint col,
   
   /* XXXXX  Attempt to set cell color */
   range = g_malloc(sizeof(GtkSheetRange));
-  if (range == NULL) {
-    g_error ("Can't malloc range");
-    return;
-  }
   range->row0 = row;
   range->rowi = row;
   range->col0 = col;
diff --git a/gnetlist/src/s_rename.c b/gnetlist/src/s_rename.c
index 745a84a..15eee0a 100644
--- a/gnetlist/src/s_rename.c
+++ b/gnetlist/src/s_rename.c
@@ -98,11 +98,6 @@ void s_rename_next_set(void)
     SET * new_set;
     
     new_set = g_malloc(sizeof(SET));
-    if (new_set == NULL) 
-    {
-        fprintf(stderr,"Unable to create a new rename set.\n");
-        exit(-1);
-    }
     memset(new_set,0,sizeof(SET));
     if (first_set)
     {
@@ -189,8 +184,6 @@ void s_rename_add(char *src, char *dest)
                        dest, temp->src, temp->dest, src, temp->dest);
 #endif
                 new_rename = g_malloc(sizeof(RENAME));
-		if (new_rename)
-		{
 		     new_rename->next = NULL;
                      new_rename->src = g_strdup(src);
                      new_rename->dest = g_strdup(temp->dest);
@@ -204,7 +197,6 @@ void s_rename_add(char *src, char *dest)
 		         last_set->last_rename->next = new_rename;
 			 last_set->last_rename = new_rename;
 		     } 
-                }
             }
             if (temp == last)
             {
@@ -218,15 +210,10 @@ void s_rename_add(char *src, char *dest)
 	if (first_set == NULL)
 	{
 	    new_set = g_malloc(sizeof(SET));
-	    if (new_set)
-	    {
 	        memset(new_set,0,sizeof(SET));
 		first_set = last_set = new_set;
-	    }
 	}    
         new_rename = g_malloc(sizeof(RENAME));
-        if (new_rename)
-	{
 	     new_rename->next = NULL;
              new_rename->src = g_strdup(src);
              new_rename->dest = g_strdup(dest);
@@ -239,7 +226,6 @@ void s_rename_add(char *src, char *dest)
 	         last_set->last_rename->next = new_rename;
 		 last_set->last_rename = new_rename;
 	     } 
-        }
     }
 }
 
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 531ce1a..a733e94 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -142,11 +142,6 @@ OBJECT *s_basic_init_object( char *name )
 
   new_node = (OBJECT *) g_malloc(sizeof(OBJECT));	
 
-  if (new_node == NULL) {
-    fprintf(stderr, "Could not perform malloc; something is broken or increase your process limits\n");
-    exit(-1);
-  }
-
   /* setup sid */
   new_node->sid = global_sid++;
   new_node->type = -1;

commit a3513b7e6dc7bf6c36d95d4da86082beeb79831d
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:57 2008 +0200

    Replace standard string manipulations with GLib string utility functions.

diff --git a/gattrib/src/s_rename.c b/gattrib/src/s_rename.c
index d8bd735..1399493 100644
--- a/gattrib/src/s_rename.c
+++ b/gattrib/src/s_rename.c
@@ -183,15 +183,9 @@ void s_rename_add(char *src, char *dest)
 #endif
 
 		    rename_pairs[cur_set][rename_counter].src =
-			(char *) g_malloc(sizeof(char) * (strlen(src) + 1));
-		    strcpy(rename_pairs[cur_set][rename_counter].src, src);
+			g_strdup(src);
 		    rename_pairs[cur_set][rename_counter].dest =
-			(char *) g_malloc(sizeof(char) *
-					(strlen
-					 (rename_pairs[cur_set][i].dest) +
-					 1));
-		    strcpy(rename_pairs[cur_set][rename_counter].dest,
-			   rename_pairs[cur_set][i].dest);
+			g_strdup(rename_pairs[cur_set][i].dest);
 		    rename_counter++;
 		}
 	    }
@@ -199,11 +193,9 @@ void s_rename_add(char *src, char *dest)
     } else {
 
 	rename_pairs[cur_set][rename_counter].src =
-	    (char *) g_malloc(sizeof(char) * (strlen(src) + 1));
-	strcpy(rename_pairs[cur_set][rename_counter].src, src);
+	    g_strdup(src);
 	rename_pairs[cur_set][rename_counter].dest =
-	    (char *) g_malloc(sizeof(char) * (strlen(dest) + 1));
-	strcpy(rename_pairs[cur_set][rename_counter].dest, dest);
+	    g_strdup(dest);
 	rename_counter++;
     }
     if (rename_counter == MAX_RENAME) {
@@ -236,8 +228,7 @@ void s_rename_all_lowlevel(NETLIST * netlist_head, char *src, char *dest)
 			/*g_free(pl_current->net_name); */
 
 			pl_current->net_name =
-			    g_malloc(sizeof(char) * (strlen(dest) + 1));
-			strcpy(pl_current->net_name, dest);
+			    g_strdup(dest);
 		    }
 		}
 
diff --git a/gnetlist/src/gnetlist.c b/gnetlist/src/gnetlist.c
index 09ddd88..fa4f628 100644
--- a/gnetlist/src/gnetlist.c
+++ b/gnetlist/src/gnetlist.c
@@ -118,9 +118,7 @@ void main_prog(void *closure, int argc, char *argv[])
     TOPLEVEL *pr_current;
 
     /* set default output filename */
-    output_filename =
-        (char *) g_malloc(sizeof(char) * (strlen("output.net") + 1));
-    strcpy(output_filename, "output.net");
+    output_filename = g_strdup("output.net");
 
     argv_index = parse_commandline(argc, argv);
     cwd = getcwd(NULL, MAXPATHLEN);
diff --git a/gnetlist/src/parsecmd.c b/gnetlist/src/parsecmd.c
index 19adb01..bf2ef94 100644
--- a/gnetlist/src/parsecmd.c
+++ b/gnetlist/src/parsecmd.c
@@ -162,9 +162,7 @@ int parse_commandline(int argc, char *argv[])
 	    break;
 
 	case 'g':
-	    guile_proc = (char *) g_malloc(sizeof(char) *
-					 (strlen(optarg) + 1));
-	    strcpy(guile_proc, optarg);
+	    guile_proc = g_strdup(optarg);
 
 	    break;
 
@@ -183,9 +181,7 @@ int parse_commandline(int argc, char *argv[])
 
 	case 'o':
 	    g_free(output_filename);
-	    output_filename = (char *) g_malloc(sizeof(char) *
-					      (strlen(optarg) + 1));
-	    strcpy(output_filename, optarg);
+	    output_filename = g_strdup(optarg);
 	    break;
 
 	case 'O':        
diff --git a/gnetlist/src/s_hierarchy.c b/gnetlist/src/s_hierarchy.c
index 11e9c47..2f0cc06 100644
--- a/gnetlist/src/s_hierarchy.c
+++ b/gnetlist/src/s_hierarchy.c
@@ -564,9 +564,7 @@ s_hierarchy_remove_uref_mangling(TOPLEVEL * pr_current, NETLIST * head)
 		    sscanf(n_current->connected_to, "%s %s", uref, pin);
 		    new_uref =
 			s_hierarchy_return_baseuref(pr_current, uref);
-		    new_connected_to =
-			g_strdup(n_current->connected_to);
-		    sprintf(new_connected_to, "%s %s", new_uref, pin);
+		    new_connected_to = g_strdup_printf("%s %s", new_uref, pin);
 		    g_free(n_current->connected_to);
 		    n_current->connected_to = new_connected_to;
 		}
@@ -586,7 +584,6 @@ char *s_hierarchy_return_baseuref(TOPLEVEL * pr_current, char *uref)
     char *start_of_base = NULL;
     char *end_of_base = NULL;
     char *cptr = NULL;
-    int i = 0;
 
     /* use hierarchy separator */
 
@@ -618,14 +615,7 @@ char *s_hierarchy_return_baseuref(TOPLEVEL * pr_current, char *uref)
 
 	cptr = uref;
 
-	return_value = (char *) g_malloc(sizeof(char) * (strlen(uref)));
-	i = 0;
-	while (cptr != end_of_base) {
-	    return_value[i] = *cptr;
-	    i++;
-	    cptr++;
-	}
-	return_value[i] = '\0';
+	return_value = g_strndup(uref, end_of_base - uref);
     }
 
 #if DEBUG
diff --git a/gnetlist/src/s_net.c b/gnetlist/src/s_net.c
index da1287b..f507fe0 100644
--- a/gnetlist/src/s_net.c
+++ b/gnetlist/src/s_net.c
@@ -180,30 +180,19 @@ char *s_net_return_connected_string(TOPLEVEL * pr_current, OBJECT * object,
     uref = s_hierarchy_create_uref(pr_current, temp_uref, hierarchy_tag);
 
     if (uref && pinnum) {
-	string = (char *) g_malloc(sizeof(char) *
-				 strlen(uref) + strlen(pinnum) +
-				 strlen("  ") + 1);
-
-	sprintf(string, "%s %s", uref, pinnum);
+	string = g_strdup_printf("%s %s", uref, pinnum);
     } else {
 	if (pinnum) {
-	    string = (char *) g_malloc(sizeof(char) *
-				     strlen(pinnum) +
-				     strlen("POWER") + strlen("  ") + 1);
-	    sprintf(string, "POWER %s", pinnum);
+	    string = g_strdup_printf("POWER %s", pinnum);
 	} else {
-	    string = (char *) g_malloc(sizeof(char) *
-				     strlen("U?") + strlen("?") +
-				     strlen("  ") + 1 + hierarchy_tag_len);
-
 	    if (hierarchy_tag) {
 		misc =
 		    s_hierarchy_create_uref(pr_current, "U?",
 					    hierarchy_tag);
-		sprintf(string, "%s ?", misc);
+		string = g_strdup_printf("%s ?", misc);
 		g_free(misc);
 	    } else {
-		sprintf(string, "U? ?");
+		string = g_strdup("U? ?");
 	    }
 
 	    fprintf(stderr, "Missing Attributes (refdes and pin number)\n");
@@ -424,12 +413,8 @@ char *s_net_name(TOPLEVEL * pr_current, NETLIST * netlist_head,
 
     if (net_head->nid == -1 && net_head->prev == NULL
 	&& net_head->next == NULL) {
-	string =
-	    (char *) g_malloc(sizeof(char) * (strlen("unconnected_pin-")) +
-			    10);
-
-	sprintf(string, "unconnected_pin-%d", 
-		unnamed_pin_counter++);
+	string = g_strdup_printf("unconnected_pin-%d",
+                           unnamed_pin_counter++);
 
 	return (string);
 
@@ -447,29 +432,21 @@ char *s_net_name(TOPLEVEL * pr_current, NETLIST * netlist_head,
 
 	if (netlist_mode == SPICE) {
 	    string =
-		(char *) g_malloc(sizeof(char) * (strlen("99999") + 10));
-	    sprintf(string, "%d", unnamed_net_counter++);
+        g_strdup_printf("%d", unnamed_net_counter++);
 
 	    return (string);
 	} else {
-	    string =
-		(char *) g_malloc(sizeof(char) *
-				(strlen(pr_current->unnamed_netname) + 10 +
-				 hierarchy_tag_len));
-
 	    if (hierarchy_tag) {
-		temp =
-		    (char *) g_malloc(sizeof(char) * (strlen("99999") + 10));
-		sprintf(temp, "%s%d", pr_current->unnamed_netname, 
+		temp = g_strdup_printf("%s%d", pr_current->unnamed_netname, 
 		        unnamed_net_counter++);
 
 		misc =
 		    s_hierarchy_create_netname(pr_current, temp,
 					       hierarchy_tag);
-		strcpy(string, misc);
+		string = g_strdup(misc);
 		g_free(misc);
 	    } else {
-		sprintf(string, "%s%d", pr_current->unnamed_netname, 
+		string = g_strdup_printf("%s%d", pr_current->unnamed_netname, 
 			unnamed_net_counter++);
 	    }
 
diff --git a/gnetlist/src/s_netattrib.c b/gnetlist/src/s_netattrib.c
index 36a0101..ed21ebc 100644
--- a/gnetlist/src/s_netattrib.c
+++ b/gnetlist/src/s_netattrib.c
@@ -130,14 +130,10 @@ s_netattrib_create_pins(TOPLEVEL * pr_current, OBJECT * o_current,
 		    s_hierarchy_create_netattrib(pr_current, net_name,
 						 hierarchy_tag);
 		old_cpin->nets->net_name_has_priority = TRUE;
-		connected_to =
-		    (char *) g_malloc(sizeof(char) *
-				    (strlen
-				     (netlist->component_uref) +
-				     strlen(current_pin) + 2));
-		sprintf(connected_to, "%s %s",
-			netlist->component_uref, current_pin);
-		old_cpin->nets->connected_to = g_strdup (connected_to);
+		connected_to = g_strdup_printf("%s %s",
+                                   netlist->component_uref,
+                                   current_pin);
+		old_cpin->nets->connected_to = g_strdup(connected_to);
 		old_cpin->nets->nid = o_current->sid;
 		g_free(connected_to);
 	    } else {
@@ -156,13 +152,9 @@ s_netattrib_create_pins(TOPLEVEL * pr_current, OBJECT * o_current,
 		    s_hierarchy_create_netattrib(pr_current, net_name,
 						 hierarchy_tag);
 
-		connected_to =
-		    (char *) g_malloc(sizeof(char) *
-				    (strlen
-				     (netlist->component_uref) +
-				     strlen(current_pin) + 2));
-		sprintf(connected_to, "%s %s",
-			netlist->component_uref, current_pin);
+		connected_to = g_strdup_printf("%s %s",
+                                   netlist->component_uref,
+                                   current_pin);
 		new_cpin->nets->connected_to = g_strdup(connected_to);
 		new_cpin->nets->nid = o_current->sid;
 
diff --git a/gnetlist/src/s_rename.c b/gnetlist/src/s_rename.c
index aaaf3a9..745a84a 100644
--- a/gnetlist/src/s_rename.c
+++ b/gnetlist/src/s_rename.c
@@ -192,10 +192,8 @@ void s_rename_add(char *src, char *dest)
 		if (new_rename)
 		{
 		     new_rename->next = NULL;
-                     new_rename->src = (char *) g_malloc(sizeof(char) * (strlen(src) + 1));
-                     strcpy(new_rename->src, src);
-                     new_rename->dest = (char *) g_malloc(sizeof(char) * (strlen(temp->dest) + 1));
-                     strcpy(new_rename->dest, temp->dest);
+                     new_rename->src = g_strdup(src);
+                     new_rename->dest = g_strdup(temp->dest);
 		     /* If the rename pair was found then a set already exists, so there's no need the check it */
 		     if (last_set->first_rename == NULL)
 		     {
@@ -230,10 +228,8 @@ void s_rename_add(char *src, char *dest)
         if (new_rename)
 	{
 	     new_rename->next = NULL;
-             new_rename->src = (char *) g_malloc(sizeof(char) * (strlen(src) + 1));
-             strcpy(new_rename->src, src);
-             new_rename->dest = (char *) g_malloc(sizeof(char) * (strlen(dest) + 1));
-             strcpy(new_rename->dest, dest);
+             new_rename->src = g_strdup(src);
+             new_rename->dest = g_strdup(dest);
 	     if (last_set->first_rename == NULL)
 	     {
 	         last_set->first_rename = last_set->last_rename = new_rename;
@@ -265,8 +261,7 @@ void s_rename_all_lowlevel(NETLIST * netlist_head, char *src, char *dest)
 		{
                     if (strcmp(pl_current->net_name, src) == 0) 
 		    {
-                        pl_current->net_name = g_malloc(sizeof(char) * (strlen(dest) + 1));
-                        strcpy(pl_current->net_name, dest);
+                        pl_current->net_name = g_strdup(dest);
                     }
                 }
                 pl_current = pl_current->next;
diff --git a/gnetlist/src/s_traverse.c b/gnetlist/src/s_traverse.c
index 4f3328b..86917fc 100644
--- a/gnetlist/src/s_traverse.c
+++ b/gnetlist/src/s_traverse.c
@@ -177,10 +177,7 @@ s_traverse_sheet(TOPLEVEL * pr_current, OBJECT * start,
 	  fprintf(stderr,
 		  "Could not find refdes on component and could not find any special attributes!\n");
 	  
-	  netlist->component_uref =
-	    (char *) g_malloc(sizeof(char) * strlen("U?") +
-			    1);
-	  strcpy(netlist->component_uref, "U?");
+	  netlist->component_uref = g_strdup("U?");
 	} else {
 	  
 #if DEBUG
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index d6247ec..bf68e1c 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -75,19 +75,12 @@ static const char *fnameext_get(const char* fname)
 static char *fnameext_remove(const char *fname)
 {
   const char *p = fnameext_get(fname);
-  char *fname_new;
-  int len;
+  char *fname_new = NULL;
 
   if(*p == '\0') {
     fname_new = g_strdup (p);
   } else {
-    len = (p - fname); /*  + 1; this extra was causing grief */
-    fname_new = (char *) g_malloc(sizeof(char) * (len + 1));
-    if(fname_new == NULL) {
-      return NULL;
-    }
-    strncpy(fname_new, fname, len);
-    fname_new[len] = '\0';
+    fname_new = g_strndup (fname_new, p - fname);
   }
   return fname_new;
 }
diff --git a/gschem/src/o_slot.c b/gschem/src/o_slot.c
index b63ddb4..d8363d7 100644
--- a/gschem/src/o_slot.c
+++ b/gschem/src/o_slot.c
@@ -81,13 +81,7 @@ void o_slot_start(GSCHEM_TOPLEVEL *w_current, OBJECT *list)
         o_attrib_search_default_slot(object);
 
       if (default_slot_value) {
-				/* two is for null and equals sign */
-        slot_value = (char *) g_malloc(sizeof(char)*(
-                                                   strlen("slot")+
-                                                   strlen(default_slot_value)+
-                                                   2));
-        sprintf(slot_value, "slot=%s",
-                default_slot_value);
+        slot_value = g_strdup_printf ("slot=%s", default_slot_value);
       } else {
 				/* no default, make something up? */
 				/* for now.. this is an error
diff --git a/gschem/src/o_undo.c b/gschem/src/o_undo.c
index 3d2d2a8..f262562 100644
--- a/gschem/src/o_undo.c
+++ b/gschem/src/o_undo.c
@@ -104,15 +104,9 @@ void o_undo_savestate(GSCHEM_TOPLEVEL *w_current, int flag)
       toplevel->page_current->ops_since_last_backup++;
     }
 
-    /* 32 is? for max length of pid and index */
-
-
-    filename = g_malloc(sizeof(char)*(strlen("/gschem.save_.sch")
-                                      + strlen(TMP) + 32));
-
-    sprintf(filename, "%s%cgschem.save%d_%d.sch", TMP, G_DIR_SEPARATOR,
-            prog_pid, 
-            undo_file_index++);
+    filename = g_strdup_printf("%s%cgschem.save%d_%d.sch",
+                               TMP, G_DIR_SEPARATOR,
+                               prog_pid, undo_file_index++);
 
     /* Changed from f_save to o_save when adding backup copy creation. */
     /* f_save manages the creaton of backup copies. 
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index a2aa003..180fbbf 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -3187,20 +3187,12 @@ int text_view_calculate_real_tab_width(GtkTextView *textview, int tab_size)
 {
   PangoLayout *layout;
   gchar *tab_string;
-  gint counter = 0;
   gint tab_width = 0;
 
   if (tab_size == 0)
   return -1;
 
-  tab_string = g_malloc (tab_size + 1);
-
-  while (counter < tab_size) {
-    tab_string [counter] = ' ';
-    counter++;
-  }
-
-  tab_string [tab_size] = 0;
+  tab_string = g_strnfill (tab_size, ' ');
 
   layout = gtk_widget_create_pango_layout (
                                            GTK_WIDGET (textview),
diff --git a/gschem/src/x_menus.c b/gschem/src/x_menus.c
index 167df2c..0af0f3b 100644
--- a/gschem/src/x_menus.c
+++ b/gschem/src/x_menus.c
@@ -165,9 +165,7 @@ void get_main_menu(GtkWidget ** menubar)
         scm_keys = scm_c_eval_string (buf);
 	g_free(buf);
         if (scm_keys == SCM_BOOL_F) {
-          menu_item_keys = g_malloc(sizeof(char)*2);
-          menu_item_keys[0] = ' ';
-          menu_item_keys[1] = '\0';
+          menu_item_keys = g_strdup (" ");
         } else {
           menu_item_keys = g_strdup (SCM_STRING_CHARS (scm_keys));
         }      
@@ -191,9 +189,7 @@ void get_main_menu(GtkWidget ** menubar)
            pad = 1;
 	} 
 
-        spaces = g_malloc(sizeof(char)*(pad+1));
-        memset(spaces, ' ', pad);
-        spaces[pad] = '\0';
+        spaces = g_strnfill (pad, ' ');
         buf = g_strdup_printf("%s%s%s", menu_item_name, spaces, menu_item_keys);
 
 #if DEBUG
diff --git a/gsymcheck/src/s_check.c b/gsymcheck/src/s_check.c
index 75cf75a..476759f 100644
--- a/gsymcheck/src/s_check.c
+++ b/gsymcheck/src/s_check.c
@@ -282,9 +282,7 @@ s_check_device(OBJECT *o_current, SYMCHECK *s_current)
   } else {
     /* found device= attribute */
     s_current->missing_device_attrib=FALSE;
-    s_current->device_attribute =
-      (char *) g_malloc(sizeof(char)*(strlen(temp)+1));
-    strcpy(s_current->device_attribute, temp);
+    s_current->device_attribute = g_strdup (temp);
     message = g_strdup_printf ("Found device=%s\n", temp);
     s_current->info_messages = g_list_append(s_current->info_messages,
 		                             message);
diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index e26a20e..eb29775 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -673,8 +673,6 @@ void o_attrib_free_current(TOPLEVEL *toplevel)
  */
 void o_attrib_set_string(TOPLEVEL *toplevel, char *string)
 {
-  int len;
-
   /* need to put an error messages here */
   if (string == NULL)  {
     fprintf(stderr, "error! string in set_string was NULL\n");
@@ -686,11 +684,7 @@ void o_attrib_set_string(TOPLEVEL *toplevel, char *string)
     toplevel->current_attribute=NULL;
   }
 
-  len = strlen(string);
-
-  toplevel->current_attribute = (char *) g_malloc(sizeof(char)*len+1);
-
-  strcpy(toplevel->current_attribute,string);
+  toplevel->current_attribute = g_strdup (string);
 	
   /* be sure to g_free this string somewhere and free the input string */
 }
@@ -800,9 +794,7 @@ char *o_attrib_search_name(OBJECT *list, char *name, int counter)
                 if (counter != internal_counter) {
                   internal_counter++;	
                 } else {
-                  return_string = (char *) 
-                    g_malloc(sizeof(char)*strlen(found_value)+1);
-                  strcpy(return_string, found_value);
+                  return_string = g_strdup (found_value);
 		  g_free(found_name);
 		  g_free(found_value);
                   return(return_string);
@@ -835,9 +827,7 @@ char *o_attrib_search_name(OBJECT *list, char *name, int counter)
           if (counter != internal_counter) {
             internal_counter++;	
           } else {
-            return_string = (char *) 
-              g_malloc(sizeof(char)* strlen(found_value)+1);
-            strcpy(return_string, found_value);
+            return_string = g_strdup (found_value);
 	    g_free(found_name);
 	    g_free(found_value);
             return(return_string);
@@ -1159,9 +1149,7 @@ o_attrib_search_attrib_name(GList *list, char *name, int counter)
             if (counter != internal_counter) {
               internal_counter++;	
             } else {
-              return_string = (char *) 
-                g_malloc(sizeof(char)* strlen(found_value)+1);
-              strcpy(return_string, found_value);
+              return_string = g_strdup (found_value);
 	      g_free(found_name);
 	      g_free(found_value);
               return(return_string);
@@ -1221,9 +1209,7 @@ char *o_attrib_search_toplevel(OBJECT *list, char *name, int counter)
           if (counter != internal_counter) {
             internal_counter++;	
           } else {
-            return_string = (char *) 
-              g_malloc(sizeof(char)* strlen(found_value)+1);
-            strcpy(return_string, found_value);
+            return_string = g_strdup (found_value);
 	    g_free(found_name);
 	    g_free(found_value);
             return(return_string);
@@ -1286,9 +1272,7 @@ char *o_attrib_search_name_single(OBJECT *object, char *name,
 
           if (val) {
             if (strcmp(name, found_name) == 0) {
-              return_string = (char *) 
-                g_malloc(sizeof(char)* strlen(found_value)+1);
-              strcpy(return_string, found_value);
+              return_string = g_strdup (found_value);
               if (return_found) {
                 *return_found = found;
               }
@@ -1320,9 +1304,7 @@ char *o_attrib_search_name_single(OBJECT *object, char *name,
 
     if (val) {
       if (strcmp(name, found_name) == 0) {
-        return_string = (char *) 
-          g_malloc(sizeof(char)* strlen(found_value)+1);
-        strcpy(return_string, found_value);
+        return_string = g_strdup (found_value);
         if (return_found) {
           *return_found = o_current;
         }
@@ -1395,9 +1377,7 @@ char *o_attrib_search_name_single_count(OBJECT *object, char *name,
               if (counter != internal_counter) {
                 internal_counter++;
               } else {
-                return_string = (char *) 
-                  g_malloc(sizeof(char)* strlen(found_value)+1);
-                strcpy(return_string, found_value);
+                return_string = g_strdup (found_value);
 		g_free(found_name);
 		g_free(found_value);
                 return(return_string);
@@ -1431,9 +1411,7 @@ char *o_attrib_search_name_single_count(OBJECT *object, char *name,
         if (counter != internal_counter) {
           internal_counter++;
         } else {
-          return_string = (char *) 
-            g_malloc(sizeof(char)* strlen(found_value)+1);
-          strcpy(return_string, found_value);
+          return_string = g_strdup (found_value);
 	  g_free(found_name);
 	  g_free(found_value);
           return(return_string);
@@ -1549,10 +1527,7 @@ OBJECT *o_attrib_search_pinseq(OBJECT *list, int pin_number)
   OBJECT *pinseq_text_object;
   char *search_for;
 
-  /* The 9 is the number of allowed digits plus null */
-  search_for = (char *) g_malloc(sizeof(char)*(strlen("pinseq=")+9));
-  sprintf(search_for, "pinseq=%d", pin_number);
-
+  search_for = g_strdup_printf ("pinseq=%d", pin_number);
   pinseq_text_object = o_attrib_search_string_list(list, search_for);
   g_free(search_for);
   
@@ -1580,10 +1555,7 @@ char *o_attrib_search_slotdef(OBJECT *object, int slotnumber)
   char *search_for=NULL;
   OBJECT *o_current;
 
-  /* The 9 is the number of digits plus null */
-  search_for = (char *) g_malloc(sizeof(char)*(strlen("slotdef=:")+9));
-
-  sprintf(search_for, "slotdef=%d:", slotnumber);
+  search_for = g_strdup_printf ("slotdef=%d:", slotnumber);
 
   o_current = object->complex->prim_objs;
   while (o_current != NULL) {
@@ -1739,12 +1711,7 @@ void o_attrib_slot_update(TOPLEVEL *toplevel, OBJECT *object)
           o_pinnum_object->text->string) {
         g_free(o_pinnum_object->text->string);
 
-        /* 9 is the size of one number plus null character */
-        o_pinnum_object->text->string = (char *)
-          g_malloc(sizeof(char)*(strlen("pinnumber=")+strlen(current_pin)+9));
-
-        /* removed _int from current_pin */
-        sprintf(o_pinnum_object->text->string, "pinnumber=%s", current_pin);
+        o_pinnum_object->text->string = g_strdup_printf ("pinnumber=%s", current_pin);
         
         o_text_recreate(toplevel, o_pinnum_object);
       }
@@ -1840,12 +1807,7 @@ void o_attrib_slot_copy(TOPLEVEL *toplevel, OBJECT *original, OBJECT *target)
         g_free(string);
         g_free(o_pinnum_object->text->string);
 
-        /* 9 is the size of one number plus null character */
-        o_pinnum_object->text->string = (char *)
-          g_malloc(sizeof(char)*(strlen("pinnumber=")+strlen(current_pin)+9));
-
-        /* removed _int from current_pin */
-        sprintf(o_pinnum_object->text->string, "pinnumber=%s", current_pin);
+        o_pinnum_object->text->string = g_strdup_printf ("pinnumber=%s", current_pin);
         
         o_text_recreate(toplevel, o_pinnum_object);
       }
diff --git a/libgeda/src/s_attrib.c b/libgeda/src/s_attrib.c
index f0d5430..8f52f63 100644
--- a/libgeda/src/s_attrib.c
+++ b/libgeda/src/s_attrib.c
@@ -64,10 +64,7 @@ int s_attrib_add_entry(char *new_attrib)
     return(-1); 
   }
 	
-  attrib[attrib_index].attrib_name = (char *) 
-    g_malloc(sizeof(char)*strlen(new_attrib)+1);
-
-  strcpy(attrib[attrib_index].attrib_name, new_attrib);
+  attrib[attrib_index].attrib_name = g_strdup (new_attrib);
 
   attrib_index++;
   return(attrib_index);
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index b6169f2..531ce1a 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -152,9 +152,7 @@ OBJECT *s_basic_init_object( char *name )
   new_node->type = -1;
 
   /* Setup the name */
-  /*! \todo get rid of magic number 16 that's the size of new_node->sid, */
-  new_node->name = (char *) g_malloc(sizeof(char)*(strlen(name)+16));
-  sprintf(new_node->name, "%s.%d", name, new_node->sid);
+  new_node->name = g_strdup_printf("%s.%d", name, new_node->sid);
 
   /* Setup the bounding box */
   new_node->w_top = 0;
diff --git a/libgeda/src/s_papersizes.c b/libgeda/src/s_papersizes.c
index 2291448..cfe3457 100644
--- a/libgeda/src/s_papersizes.c
+++ b/libgeda/src/s_papersizes.c
@@ -67,10 +67,7 @@ int s_papersizes_add_entry(char *new_papersize, int width, int height)
     return(-1); 
   }
 	
-  papersizes[papersizes_index].papersize_name = 
-    (char *) g_malloc(sizeof(char)*strlen(new_papersize)+1);
-
-  strcpy(papersizes[papersizes_index].papersize_name, new_papersize);
+  papersizes[papersizes_index].papersize_name = g_strdup (new_papersize);
 
   papersizes[papersizes_index].width = width;
   papersizes[papersizes_index].height = height;
diff --git a/libgeda/src/s_slib.c b/libgeda/src/s_slib.c
index c5b1d5d..2f0c569 100644
--- a/libgeda/src/s_slib.c
+++ b/libgeda/src/s_slib.c
@@ -74,10 +74,7 @@ int s_slib_add_entry(char *new_path)
     return(-1); 
   }
 
-  slib[slib_index].dir_name = 
-    (char *) g_malloc(sizeof(char)*strlen(new_path)+1);
-
-  strcpy(slib[slib_index].dir_name, new_path);
+  slib[slib_index].dir_name = g_strdup (new_path);
 
   slib_index++;
   return(slib_index);
@@ -112,7 +109,6 @@ int s_slib_search_for_dirname(char *dir_name)
 char *s_slib_search_dirs(const char *basename)
 {
   int i;
-  int len;
   DIR *ptr=NULL;
   struct dirent *dptr;
   char *slib_path=NULL;
@@ -138,9 +134,7 @@ char *s_slib_search_dirs(const char *basename)
 
       /* Do a substring comp for a match */
       if (strstr(dptr->d_name, basename) != NULL)  {
-        len = strlen(slib[i].dir_name);				
-        slib_path = (char *) g_malloc(sizeof(char)*len+1);
-        strcpy(slib_path, slib[i].dir_name);
+        slib_path = g_strdup (slib[i].dir_name);
 	
         if (ptr) {
           closedir(ptr);
@@ -178,7 +172,6 @@ char *s_slib_search_lowlevel(const char *basename)
 {
   char *slib_path=NULL;
   char *full_path=NULL;
-  int len;
 
   slib_path = s_slib_search_dirs(basename);
 
@@ -188,13 +181,7 @@ char *s_slib_search_lowlevel(const char *basename)
     s_log_message(_("Found [%s]\n"), basename);
     /* s_log_message("Found [%s] in [%s]\n", basename, slib_path);*/
 
-    len = strlen(basename)+strlen(slib_path);
-	
-    /* The 2 is for NULL char and the slash inbetween the two */
-    /* strings */	
-    full_path = (char *) g_malloc(sizeof(char)*(len+2));
-
-    sprintf(full_path, "%s%c%s", slib_path, G_DIR_SEPARATOR, basename);
+    full_path = g_build_filename (slib_path, basename, NULL);
 		
     g_free(slib_path);
 
@@ -323,9 +310,6 @@ char *s_slib_search(const char *filename, int flag)
   char *processed_name=NULL;
   char *new_filename=NULL;
   char *string=NULL;
-  char *number_suffix;
-  int len;
-  int len2;
   static int count;
 
   switch(flag) {
@@ -344,21 +328,14 @@ char *s_slib_search(const char *filename, int flag)
       printf("proced: %s\n", processed_name);
 #endif
 
-      len = strlen(processed_name);
-
       /* for now only look for .sch's */
       /* this needs to be *MUCH* more flexible */
       /* number_suffix is large enough ? */
-      number_suffix = g_strdup_printf("_%d.sch", count); 
-      len2 = strlen(number_suffix);
-      new_filename = (char *) 
-        g_malloc (sizeof(char)*(len+len2+1));
+      new_filename = g_strdup_printf ("%s_%d.sch", processed_name, count);
 
-      sprintf(new_filename, "%s%s", processed_name, number_suffix);
       string = s_slib_search_lowlevel(new_filename);
 
       g_free(new_filename);
-      g_free(number_suffix);
       break;
 
     case(SLIB_SEARCH_DONE):
@@ -473,7 +450,6 @@ char *s_slib_getfiles(char *directory, int flag)
   static int current=0;
 
   int j;
-  int len;
 
   switch(flag) {
 
@@ -531,14 +507,10 @@ char *s_slib_getfiles(char *directory, int flag)
         }	
 
         if (dptr->d_name != NULL) {
-          len = strlen(dptr->d_name);
-
           /* hack */
           if (count < 256) {
 
-            whole_dir[count] = (char *)
-              g_malloc(sizeof(char)*len+1);
-            strcpy(whole_dir[count], dptr->d_name);
+            whole_dir[count] = g_strdup (dptr->d_name);
             count++;
           } else {
             fprintf(stderr, 

commit da1d2e7b304f9d832bdee9c8dfb9fe4604e19cc9
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:56 2008 +0200

    Remove tests for NULL prior to freeing with g_free().
    
    Testing if pointer on memory to free is not NULL is unnecessary
    since g_free() does the test itself.

diff --git a/gattrib/src/s_sheet_data.c b/gattrib/src/s_sheet_data.c
index fc05ad4..9ba33ef 100644
--- a/gattrib/src/s_sheet_data.c
+++ b/gattrib/src/s_sheet_data.c
@@ -423,7 +423,7 @@ void s_sheet_data_add_master_pin_attrib_list_items(OBJECT *start_obj) {
 		    s_string_list_add_item(sheet_head->master_pin_attrib_list_head, 
 					   &(sheet_head->pin_attrib_count), attrib_name);
 		  }   /* if (strcmp(attrib_name, "pinnumber") != 0) */ 
-		  if (attrib_value != NULL) g_free(attrib_value);
+		  g_free(attrib_value);
 		  g_free(attrib_name);
 		  g_free(attrib_text);
 		}
diff --git a/gattrib/src/s_table.c b/gattrib/src/s_table.c
index a1530a1..d89bf68 100644
--- a/gattrib/src/s_table.c
+++ b/gattrib/src/s_table.c
@@ -138,12 +138,9 @@ void s_table_destroy(TABLE **table, int row_count, int col_count)
 
   for (i = 0; i < row_count; i++) {
     for (j = 0; j < col_count; j++) {
-      if ( (table[i][j]).attrib_value != NULL)
-	g_free( (table[i][j]).attrib_value );
-      if ( (table[i][j]).row_name != NULL)
-	g_free( (table[i][j]).row_name );
-      if ( (table[i][j]).col_name != NULL)
-	g_free( (table[i][j]).col_name );
+      g_free( (table[i][j]).attrib_value );
+      g_free( (table[i][j]).row_name );
+      g_free( (table[i][j]).col_name );
     }
   }
 
@@ -652,9 +649,7 @@ void s_table_gtksheet_to_table(GtkSheet *local_gtk_sheet, STRING_LIST *master_ro
 #ifdef DEBUG
       printf("     Updating attrib_value %s\n", attrib_value);
 #endif
-      if ( local_table[row][col].attrib_value != NULL) {
-	g_free( local_table[row][col].attrib_value );
-      }
+      g_free( local_table[row][col].attrib_value );
       if (attrib_value != NULL) {
 	local_table[row][col].attrib_value = (gchar *) g_strdup(attrib_value);
       } else {
@@ -665,9 +660,7 @@ void s_table_gtksheet_to_table(GtkSheet *local_gtk_sheet, STRING_LIST *master_ro
 #ifdef DEBUG
       printf("     Updating row_name %s\n", row_title);
 #endif
-      if ( local_table[row][col].row_name != NULL) {
-	g_free( local_table[row][col].row_name );
-      }
+      g_free( local_table[row][col].row_name );
       if (row_title != NULL) {
 	local_table[row][col].row_name = (gchar *) g_strdup(row_title);
       } else {
@@ -678,9 +671,7 @@ void s_table_gtksheet_to_table(GtkSheet *local_gtk_sheet, STRING_LIST *master_ro
 #ifdef DEBUG
       printf("     Updating col_name %s\n", col_title);
 #endif
-      if ( local_table[row][col].col_name != NULL) {
-	g_free( local_table[row][col].col_name );
-      }
+      g_free( local_table[row][col].col_name );
       if (col_title != NULL) {
 	local_table[row][col].col_name = (gchar *) g_strdup(col_title);
       } else {
diff --git a/gattrib/src/s_toplevel.c b/gattrib/src/s_toplevel.c
index ca3177e..f1e9046 100644
--- a/gattrib/src/s_toplevel.c
+++ b/gattrib/src/s_toplevel.c
@@ -650,8 +650,8 @@ void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current,
 	     (s_attrib_name_in_list(new_comp_attrib_list, old_attrib_name) == FALSE) ) {
 	  s_string_list_add_item(complete_comp_attrib_list, &count, old_name_value_pair);
         }
-	if (old_attrib_name) g_free (old_attrib_name);
-	if (old_attrib_value) g_free (old_attrib_value);
+	g_free (old_attrib_name);
+	g_free (old_attrib_value);
       }
  #endif
      g_free(old_name_value_pair);
@@ -777,18 +777,10 @@ void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current,
     
 
     /* free everything and iterate */
-    if (new_attrib_name != NULL) {
-      g_free(new_attrib_name);  /* Be careful, this can be NULL */
-    }
-    if (new_attrib_value != NULL) {
-      g_free(new_attrib_value);  /* Be careful, this can be NULL */
-    }
-    if (old_attrib_name != NULL) {
-      g_free(old_attrib_name);  /* Be careful, this can be NULL */
-    }
-    if (old_attrib_value != NULL) {
-      g_free(old_attrib_value);  /* Be careful, this can be NULL */
-    }
+    g_free(new_attrib_name);
+    g_free(new_attrib_value);
+    g_free(old_attrib_name);
+    g_free(old_attrib_value);
     local_list = local_list->next;
   }   /*   while (local_list != NULL)  */
   return;
@@ -943,8 +935,7 @@ void s_toplevel_update_pin_attribs_in_toplevel(char *refdes, OBJECT *o_pin,
   new_attrib_value = u_basic_breakup_string(new_name_value_pair, '=', 1);
 
   if (strlen(new_attrib_value) == 0) {
-    if (new_attrib_value != NULL)
-      g_free(new_attrib_value);   
+    g_free(new_attrib_value);   
     new_attrib_value = NULL;  /* s_misc_remaining_string doesn't return NULL for empty substring. */
   }
   old_attrib_value = o_attrib_search_name_single_count(o_pin, new_attrib_name, 0);
@@ -995,12 +986,8 @@ void s_toplevel_update_pin_attribs_in_toplevel(char *refdes, OBJECT *o_pin,
     /* free everything and iterate */
     g_free(new_name_value_pair);
     g_free(new_attrib_name);
-    if (new_attrib_value != NULL) {
-      g_free(new_attrib_value);  /* Be careful, this can be NULL */
-    }
-    if (old_attrib_value != NULL) {
-      g_free(old_attrib_value);  /* Be careful, this can be NULL */
-    }
+    g_free(new_attrib_value);
+    g_free(old_attrib_value);
     local_list = local_list->next;
   }   /*   while (local_list != NULL)  */
 
diff --git a/gnetlist/src/g_rc.c b/gnetlist/src/g_rc.c
index ba41c67..a03a598 100644
--- a/gnetlist/src/g_rc.c
+++ b/gnetlist/src/g_rc.c
@@ -127,9 +127,7 @@ SCM g_rc_hierarchy_netname_separator(SCM name)
   SCM_ASSERT (scm_is_string (name), name,
               SCM_ARG1, "hierarchy-netname-separator");
 
-  if (default_hierarchy_netname_separator) {
-    g_free(default_hierarchy_netname_separator);
-  }
+  g_free(default_hierarchy_netname_separator);
 
   default_hierarchy_netname_separator = g_strdup (SCM_STRING_CHARS (name));
 
@@ -141,9 +139,7 @@ SCM g_rc_hierarchy_netattrib_separator(SCM name)
   SCM_ASSERT (scm_is_string (name), name,
               SCM_ARG1, "hierarchy-netattrib-separator");
 
-  if (default_hierarchy_netattrib_separator) {
-    g_free(default_hierarchy_netattrib_separator);
-  }
+  g_free(default_hierarchy_netattrib_separator);
 
   default_hierarchy_netattrib_separator = g_strdup (SCM_STRING_CHARS (name));
 
@@ -155,9 +151,7 @@ SCM g_rc_hierarchy_uref_separator(SCM name)
   SCM_ASSERT (scm_is_string (name), name,
               SCM_ARG1, "hierarchy-uref-separator");
 
-  if (default_hierarchy_uref_separator) {
-    g_free(default_hierarchy_uref_separator);
-  }
+  g_free(default_hierarchy_uref_separator);
 
   default_hierarchy_uref_separator = g_strdup (SCM_STRING_CHARS (name));
 
@@ -202,9 +196,7 @@ SCM g_rc_unnamed_netname(SCM name)
   SCM_ASSERT (scm_is_string (name), name,
               SCM_ARG1, "unamed-netname");
 
-  if (default_unnamed_netname) {
-    g_free(default_unnamed_netname);
-  }
+  g_free(default_unnamed_netname);
 
   default_unnamed_netname = g_strdup (SCM_STRING_CHARS (name));
 
diff --git a/gnetlist/src/i_vars.c b/gnetlist/src/i_vars.c
index 9db7dc8..c8203c8 100644
--- a/gnetlist/src/i_vars.c
+++ b/gnetlist/src/i_vars.c
@@ -42,9 +42,7 @@
 #define DEFAULT_BITMAP_DIRECTORY   "non-existant"
 
 #define INIT_STR(w, name, str) {                            \
-    if ((w)->name) {                                        \
-        g_free((w)->name);                                  \
-    }                                                       \
+    g_free((w)->name);                                      \
     (w)->name = g_strdup (((default_ ## name) != NULL) ?    \
                           (default_ ## name) : (str));      \
 }
diff --git a/gnetlist/src/parsecmd.c b/gnetlist/src/parsecmd.c
index cd7129b..19adb01 100644
--- a/gnetlist/src/parsecmd.c
+++ b/gnetlist/src/parsecmd.c
@@ -182,9 +182,7 @@ int parse_commandline(int argc, char *argv[])
            break;
 
 	case 'o':
-	    if (output_filename) {
-		g_free(output_filename);
-	    }
+	    g_free(output_filename);
 	    output_filename = (char *) g_malloc(sizeof(char) *
 					      (strlen(optarg) + 1));
 	    strcpy(output_filename, optarg);
diff --git a/gnetlist/src/s_hierarchy.c b/gnetlist/src/s_hierarchy.c
index b6c8b0c..11e9c47 100644
--- a/gnetlist/src/s_hierarchy.c
+++ b/gnetlist/src/s_hierarchy.c
@@ -126,13 +126,9 @@ s_hierarchy_traverse(TOPLEVEL * pr_current, OBJECT * o_current,
 	    current_filename = u_basic_breakup_string(attrib, ',', pcount);
 	}
 
-	if (attrib) {
-	    g_free(attrib);
-	}
+	g_free(attrib);
 
-	if (current_filename) {
-	    g_free(current_filename);
-	}
+	g_free(current_filename);
 
 	count++;
 
diff --git a/gnetlist/src/s_net.c b/gnetlist/src/s_net.c
index 6eaf591..da1287b 100644
--- a/gnetlist/src/s_net.c
+++ b/gnetlist/src/s_net.c
@@ -210,14 +210,11 @@ char *s_net_return_connected_string(TOPLEVEL * pr_current, OBJECT * object,
 	}
     }
 
-    if (pinnum)
-	g_free(pinnum);
+    g_free(pinnum);
 
-    if (uref)
-	g_free(uref);
+    g_free(uref);
 
-    if (temp_uref)
-	g_free(temp_uref);
+    g_free(temp_uref);
 
     return (string);
 }
diff --git a/gnetlist/src/s_netattrib.c b/gnetlist/src/s_netattrib.c
index 4e900b7..36a0101 100644
--- a/gnetlist/src/s_netattrib.c
+++ b/gnetlist/src/s_netattrib.c
@@ -215,9 +215,7 @@ s_netattrib_handle(TOPLEVEL * pr_current, OBJECT * o_current,
     }
 
 
-    if (value) {
-	g_free(value);
-    }
+    g_free(value);
 
 
     /* for now just look inside the component */
@@ -234,9 +232,7 @@ s_netattrib_handle(TOPLEVEL * pr_current, OBJECT * o_current,
 	    o_attrib_search_name_single_count(o_current, "net", counter);
     }
 
-    if (value) {
-	g_free(value);
-    }
+    g_free(value);
 }
 
 char *s_netattrib_net_search(OBJECT * o_current, char *wanted_pin)
@@ -294,9 +290,7 @@ char *s_netattrib_net_search(OBJECT * o_current, char *wanted_pin)
     }
 
 
-    if (value) {
-	g_free(value);
-    }
+    g_free(value);
 
 
     /* now look outside the component */
@@ -341,9 +335,7 @@ char *s_netattrib_net_search(OBJECT * o_current, char *wanted_pin)
 	    o_attrib_search_name_single_count(o_current, "net", counter);
     }
 
-    if (value) {
-	g_free(value);
-    }
+    g_free(value);
 
     if (return_value) {
 	return (return_value);
diff --git a/gnetlist/src/s_netlist.c b/gnetlist/src/s_netlist.c
index 3aa7e06..d9e768d 100644
--- a/gnetlist/src/s_netlist.c
+++ b/gnetlist/src/s_netlist.c
@@ -166,9 +166,7 @@ void s_netlist_post_process(TOPLEVEL * pr_current, NETLIST * head)
 
 		if (pl_current->plid != -1 && pl_current->nets) {
 
-		    if (pl_current->net_name) {
-			g_free(pl_current->net_name);
-		    }
+		    g_free(pl_current->net_name);
 
 		    verbose_print("n");
 
@@ -253,9 +251,7 @@ void s_netlist_name_named_nets (TOPLEVEL *pr_current,
 	  net_name = NULL;
 	  n_current = pl_current->nets;
 	  while (n_current != NULL) {
-	    if (n_current->net_name) {
-	      g_free (n_current->net_name);
-	    }	    
+	    g_free (n_current->net_name);
 	    n_current->net_name = s_netlist_netname_of_netid(pr_current,
 							     named_netlist,
 							     n_current->nid);
diff --git a/gnetlist/src/s_rename.c b/gnetlist/src/s_rename.c
index 7775083..aaaf3a9 100644
--- a/gnetlist/src/s_rename.c
+++ b/gnetlist/src/s_rename.c
@@ -80,14 +80,8 @@ void s_rename_destroy_all(void)
     {
         for (temp = first_set->first_rename; temp;)
         {
-            if (temp->src) 
-            {
-                g_free(temp->src);
-            }
-            if (temp->dest) 
-	    {
-                g_free(temp->dest);
-            }
+            g_free(temp->src);
+            g_free(temp->dest);
 	    to_free = temp;
 	    temp = temp->next;
 	    g_free(to_free);
diff --git a/gnetlist/src/vams_misc.c b/gnetlist/src/vams_misc.c
index 21fc5cf..9b0d0ed 100644
--- a/gnetlist/src/vams_misc.c
+++ b/gnetlist/src/vams_misc.c
@@ -61,8 +61,8 @@ vams_get_attribs_list(OBJECT *object, SCM *list, OBJECT **return_found)
         *list = scm_cons (scm_makfrom0str (found_name), *list);
       }
 
-     if (found_name) g_free(found_name);
-     if (found_value) g_free(found_value);
+     g_free(found_name);
+     g_free(found_value);
 #if DEBUG
       printf("0 _%s_\n", found->text->string);
       printf("1 _%s_\n", found_name);
diff --git a/gschem/src/gschem_dialog.c b/gschem/src/gschem_dialog.c
index 0daadbc..7c8410f 100644
--- a/gschem/src/gschem_dialog.c
+++ b/gschem/src/gschem_dialog.c
@@ -279,7 +279,7 @@ static void gschem_dialog_finalize (GObject *object)
 {
   GschemDialog *dialog = GSCHEM_DIALOG (object);
 
-  if (dialog->settings_name) g_free (dialog->settings_name);
+  g_free (dialog->settings_name);
 
   G_OBJECT_CLASS (gschem_dialog_parent_class)->finalize (object);
 }
@@ -303,7 +303,7 @@ static void gschem_dialog_set_property (GObject *object, guint property_id, cons
 
   switch(property_id) {
     case PROP_SETTINGS_NAME:
-      if (dialog->settings_name) g_free (dialog->settings_name);
+      g_free (dialog->settings_name);
       dialog->settings_name = g_strdup (g_value_get_string (value));
       break;
     case PROP_GSCHEM_TOPLEVEL:
diff --git a/gschem/src/i_basic.c b/gschem/src/i_basic.c
index 6685736..3381aa4 100644
--- a/gschem/src/i_basic.c
+++ b/gschem/src/i_basic.c
@@ -106,7 +106,7 @@ static const char *i_status_string(GSCHEM_TOPLEVEL *w_current)
       return _("Pan Mode");
     case STARTPASTE:
     case ENDPASTE:
-      if (buf) g_free(buf);
+      g_free(buf);
       buf = g_strdup_printf(_("Paste %d Mode"), w_current->buffer_number+1);
       return buf;
     case STARTDRAWNET:
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index 18b40c0..d6247ec 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -403,9 +403,7 @@ DEFINE_I_CALLBACK(file_print)
     x_print_setup(w_current, ps_filename);
   }
 
-  if (ps_filename) {
-    g_free(ps_filename);
-  }
+  g_free(ps_filename);
 }
 
 /*! \todo Finish function documentation!!!
@@ -2872,8 +2870,8 @@ DEFINE_I_CALLBACK(hierarchy_down_schematic)
       current_filename = u_basic_breakup_string(attrib, ',', pcount);
     }
 
-    if (attrib)           g_free(attrib);
-    if (current_filename) g_free(current_filename);
+    g_free(attrib);
+    g_free(current_filename);
 
     count++;
 
@@ -3007,9 +3005,9 @@ DEFINE_I_CALLBACK(hierarchy_documentation)
                          object->complex_basename,
                          sourcename);
 
-      if (attrib_doc) g_free(attrib_doc);
-      if (attrib_device) g_free(attrib_device);
-      if (attrib_value) g_free(attrib_value);
+      g_free(attrib_doc);
+      g_free(attrib_device);
+      g_free(attrib_value);
     }
   } else {
     generic_msg_dialog(_("This command retrieves the component documentation from the web, but there is no component selected"));
diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index 1f370af..b548d34 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -826,8 +826,8 @@ void o_update_component(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
     attrfound = o_attrib_search_name_single(o_current, name, NULL);
 
     /* free these now since they are no longer being used */
-    if (name) { g_free(name); }
-    if (value) { g_free(value); }
+    g_free(name);
+    g_free(value);
 
     if (attrfound == NULL) {
       /* attribute with same name not found in old component: */
diff --git a/gschem/src/o_picture.c b/gschem/src/o_picture.c
index 0f08c43..cf91611 100644
--- a/gschem/src/o_picture.c
+++ b/gschem/src/o_picture.c
@@ -600,8 +600,7 @@ void o_picture_exchange (GSCHEM_TOPLEVEL *w_current, GdkPixbuf *pixbuf,
         /* Erase previous picture */
         o_erase_single(w_current, object);
 
-        if (object->picture->filename != NULL)
-          g_free(object->picture->filename);
+        g_free(object->picture->filename);
 
         object->picture->filename = (char *) g_strdup(filename);
 
diff --git a/gschem/src/o_slot.c b/gschem/src/o_slot.c
index 91c5716..b63ddb4 100644
--- a/gschem/src/o_slot.c
+++ b/gschem/src/o_slot.c
@@ -148,8 +148,8 @@ void o_slot_end(GSCHEM_TOPLEVEL *w_current, char *string, int len)
       s_log_message(_("numslots attribute missing\n"));
       s_log_message(
                     _("Slotting not allowed for this component\n"));
-      if (name) g_free(name);
-      if (value) g_free(value);
+      g_free(name);
+      g_free(value);
       return;
     }
 
@@ -164,8 +164,8 @@ void o_slot_end(GSCHEM_TOPLEVEL *w_current, char *string, int len)
 
     if (new_slot_number > numslots || new_slot_number <=0 ) {
       s_log_message(_("New slot number out of range\n"));
-      if (name) g_free(name);
-      if (value) g_free(value);
+      g_free(name);
+      g_free(value);
       return;
     }
 
@@ -174,9 +174,7 @@ void o_slot_end(GSCHEM_TOPLEVEL *w_current, char *string, int len)
     slot_value = o_attrib_search_slot(object, &slot_text_object);
 
     if (slot_value) {
-      if (slot_text_object->text->string) {
-        g_free(slot_text_object->text->string);
-      }
+      g_free(slot_text_object->text->string);
 
       slot_text_object->text->string = g_strdup (string);
 
@@ -231,14 +229,14 @@ void o_slot_end(GSCHEM_TOPLEVEL *w_current, char *string, int len)
     o_redraw_single(w_current,object);
 
     toplevel->page_current->CHANGED = 1;
-    if (name) g_free(name);
-    if (value) g_free(value);
+    g_free(name);
+    g_free(value);
 
   } else {
     fprintf(stderr,
             _("uggg! you tried to slot edit something that doesn't exist!\n"));
-    if (name) g_free(name);
-    if (value) g_free(value);
+    g_free(name);
+    g_free(value);
     exit(-1);
   }
 }
diff --git a/gschem/src/o_text.c b/gschem/src/o_text.c
index 7add762..edf7b65 100644
--- a/gschem/src/o_text.c
+++ b/gschem/src/o_text.c
@@ -441,9 +441,7 @@ void o_text_edit_end(GSCHEM_TOPLEVEL *w_current, char *string, int len, int text
 
         /* only change text string if there is only ONE text object selected */
         if (numselect == 1 && string) {
-          if (object->text->string) {
-            g_free(object->text->string);
-          }
+          g_free(object->text->string);
           object->text->string = g_strdup (string);
 	  /* handle slot= attribute, it's a special case */
 	  if (g_ascii_strncasecmp (string, "slot=", 5) == 0) {
@@ -496,9 +494,7 @@ void o_text_change(GSCHEM_TOPLEVEL *w_current, OBJECT *object, char *string,
   o_erase_single(w_current, object);
 
   /* second change the real object */
-  if (object->text->string) {
-    g_free(object->text->string);
-  }
+  g_free(object->text->string);
 
   object->text->string = g_strdup (string);
   object->visibility = visibility;
diff --git a/gschem/src/o_undo.c b/gschem/src/o_undo.c
index 307d6a1..3d2d2a8 100644
--- a/gschem/src/o_undo.c
+++ b/gschem/src/o_undo.c
@@ -176,9 +176,7 @@ void o_undo_savestate(GSCHEM_TOPLEVEL *w_current, int flag)
   printf("----\n");
 #endif
 
-  if (filename) {
-    g_free(filename);
-  }
+  g_free(filename);
 
   /* Now go through and see if we need to free/remove some undo levels */ 
   /* so we stay within the limits */
diff --git a/gschem/src/x_attribedit.c b/gschem/src/x_attribedit.c
index 08ccef5..97cd73d 100644
--- a/gschem/src/x_attribedit.c
+++ b/gschem/src/x_attribedit.c
@@ -571,8 +571,8 @@ void attrib_edit_dialog(GSCHEM_TOPLEVEL *w_current, OBJECT * list, int flag)
     gtk_widget_grab_focus(attrib_combo_entry);
   }
 
-  if (name) g_free(name);
-  if (val) g_free(val);
+  g_free(name);
+  g_free(val);
 
 }
 /***************** End of Attrib Edit dialog box **********************/
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index 1048ac1..a2aa003 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -3270,7 +3270,7 @@ void major_changed_dialog(GSCHEM_TOPLEVEL* w_current)
                               G_CALLBACK (gtk_widget_destroy),
                               dialog);
 
-    if (refdes_string) g_free(refdes_string);
+    g_free(refdes_string);
   }
 }
 
diff --git a/gschem/src/x_image.c b/gschem/src/x_image.c
index 0017564..d8dcb30 100644
--- a/gschem/src/x_image.c
+++ b/gschem/src/x_image.c
@@ -410,8 +410,7 @@ void x_image_lowlevel(GSCHEM_TOPLEVEL *w_current, const char* filename,
           s_log_message(_("Wrote black and white image to [%s] [%d x %d]\n"), filename, width, height);
         }
       }
-      if (filetype != NULL)
-        g_free(filetype);
+      g_free(filetype);
       if (pixbuf != NULL)
         g_object_unref(pixbuf);
     }
diff --git a/gschem/src/x_multiattrib.c b/gschem/src/x_multiattrib.c
index d8cd0ea..4aeebe8 100644
--- a/gschem/src/x_multiattrib.c
+++ b/gschem/src/x_multiattrib.c
@@ -721,8 +721,8 @@ static void multiattrib_callback_edited_name(GtkCellRendererText *cellrendererte
   newtext = g_strdup_printf ("%s=%s", arg2, value);
 
   if (!x_dialog_validate_attribute(GTK_WINDOW(multiattrib), newtext)) {
-    if (name) g_free (name);
-    if (value) g_free (value);
+    g_free (name);
+    g_free (value);
     g_free(newtext);
     return;
   }
@@ -771,8 +771,8 @@ static void multiattrib_callback_edited_value(GtkCellRendererText *cell_renderer
   newtext = g_strdup_printf ("%s=%s", name, arg2);
 
   if (!x_dialog_validate_attribute(GTK_WINDOW(multiattrib), newtext)) {
-    if (name) g_free (name);
-    if (value) g_free (value);
+    g_free (name);
+    g_free (value);
     g_free(newtext);
     return;
   }
diff --git a/gsymcheck/src/s_check.c b/gsymcheck/src/s_check.c
index 26c714e..75cf75a 100644
--- a/gsymcheck/src/s_check.c
+++ b/gsymcheck/src/s_check.c
@@ -304,8 +304,7 @@ s_check_device(OBJECT *o_current, SYMCHECK *s_current)
     s_current->warning_count++;
   } 
 
-  if (temp) 
-    g_free(temp);
+  g_free(temp);
 }
 
 
@@ -380,8 +379,7 @@ s_check_pinseq(OBJECT *object_head, SYMCHECK *s_current)
           found_numbers = g_list_append(found_numbers, number);
           found_first=TRUE;
         } else {
-          if (number)
-            g_free(number);
+          g_free(number);
         }
         
         counter++;
@@ -893,8 +891,7 @@ s_check_slotdef(OBJECT *object_head, SYMCHECK *s_current)
       j++;
     } while (temp);
 
-    if (temp)
-      g_free(temp);
+    g_free(temp);
 
     g_free(slotdef);
     slotdef = NULL;
@@ -963,15 +960,11 @@ s_check_slotdef(OBJECT *object_head, SYMCHECK *s_current)
     }
   }
   
-  if (slotdef) {
-    g_free(slotdef);
-  }
+  g_free(slotdef);
   if (pinlist) {
     /* Free the pinlist */
     for (i = 0; i < s_current->numslots; i++) {
-      if (pinlist[i]) {
-	g_free(pinlist[i]);
-      }
+      g_free(pinlist[i]);
     }
     g_free(pinlist);
   }
diff --git a/gsymcheck/src/s_symstruct.c b/gsymcheck/src/s_symstruct.c
index 33f04de..7c285f8 100644
--- a/gsymcheck/src/s_symstruct.c
+++ b/gsymcheck/src/s_symstruct.c
@@ -137,9 +137,7 @@ s_symstruct_free(SYMCHECK *s_current)
 {
   if (s_current) {
 
-    if (s_current->device_attribute) {
-      g_free(s_current->device_attribute);
-    }
+    g_free(s_current->device_attribute);
 
     g_free(s_current);
   }
diff --git a/libgeda/src/f_basic.c b/libgeda/src/f_basic.c
index daf0ce6..cfb052f 100644
--- a/libgeda/src/f_basic.c
+++ b/libgeda/src/f_basic.c
@@ -213,9 +213,7 @@ int f_open_flags(TOPLEVEL *toplevel, const gchar *filename,
   }
 
   /* write full, absolute filename into page_current->page_filename */
-  if (toplevel->page_current->page_filename) {
-    g_free(toplevel->page_current->page_filename);
-  }
+  g_free(toplevel->page_current->page_filename);
   toplevel->page_current->page_filename = g_strdup(full_filename);
 
   /* Before we open the page, let's load the corresponding gafrc. */
diff --git a/libgeda/src/g_rc.c b/libgeda/src/g_rc.c
index 5fb2f8e..952397f 100644
--- a/libgeda/src/g_rc.c
+++ b/libgeda/src/g_rc.c
@@ -442,9 +442,7 @@ SCM g_rc_component_library(SCM path, SCM name)
     g_free(cwd);
   }
 
-  if (string) {
-    g_free(string);
-  }
+  g_free(string);
 
   return SCM_BOOL_T;
 }
@@ -600,9 +598,7 @@ SCM g_rc_component_library_search(SCM path)
     }
   }
 
-  if (string) {
-    g_free(string);
-  }
+  g_free(string);
 
   return SCM_BOOL_T;
 }
@@ -650,9 +646,7 @@ SCM g_rc_source_library(SCM path)
     g_free(cwd);
   }
   
-  if (string) {
-    g_free(string);
-  }
+  g_free(string);
   
   return SCM_BOOL_T;
 }
@@ -690,9 +684,7 @@ SCM g_rc_source_library_search(SCM path)
     fprintf (stderr,
              "Invalid path [%s] passed to source-library-search\n",
              string);
-    if (string) {
-      g_free(string);
-    }
+    g_free(string);
     return SCM_BOOL_F;
   }
 
@@ -731,9 +723,7 @@ SCM g_rc_source_library_search(SCM path)
     }
   }
 
-  if (string) {
-    g_free(string);
-  }
+  g_free(string);
 
   return SCM_BOOL_T;
 }
@@ -792,9 +782,7 @@ SCM g_rc_default_series_name(SCM name)
   SCM_ASSERT (scm_is_string (name), name,
               SCM_ARG1, "default-series-name");
 
-  if (default_series_name) {
-    g_free(default_series_name);
-  }
+  g_free(default_series_name);
 
   default_series_name = g_strdup (SCM_STRING_CHARS (name));
 
@@ -813,9 +801,7 @@ SCM g_rc_untitled_name(SCM name)
   SCM_ASSERT (scm_is_string (name), name,
               SCM_ARG1, "untitled-name");
 
-  if (default_untitled_name) {
-    g_free(default_untitled_name);
-  }
+  g_free(default_untitled_name);
 
   default_untitled_name = g_strdup (SCM_STRING_CHARS (name));
 
@@ -844,15 +830,11 @@ SCM g_rc_font_directory(SCM path)
     fprintf (stderr,
              "Invalid path [%s] passed to font-directory\n",
              string);
-    if (string) {
-      g_free(string);
-    }
+    g_free(string);
     return SCM_BOOL_F;
   }
 
-  if (default_font_directory) {
-    g_free(default_font_directory);
-  }
+  g_free(default_font_directory);
   default_font_directory = string;
 
   return SCM_BOOL_T;
@@ -880,15 +862,11 @@ SCM g_rc_scheme_directory(SCM path)
     fprintf (stderr,
              "Invalid path [%s] passed to scheme-directory\n",
              string);
-    if (string) {
-      g_free(string);
-    }
+    g_free(string);
     return SCM_BOOL_F;
   }
 
-  if (default_scheme_directory) {
-    g_free(default_scheme_directory);
-  }
+  g_free(default_scheme_directory);
   default_scheme_directory = string;
 
   return SCM_BOOL_T;
@@ -916,15 +894,11 @@ SCM g_rc_bitmap_directory(SCM path)
     fprintf (stderr,
              "Invalid path [%s] passed to bitmap-directory\n",
              string);
-    if (string) {
-      g_free(string);
-    }
+    g_free(string);
     return SCM_BOOL_F;
   }
 
-  if (default_bitmap_directory) {
-    g_free(default_bitmap_directory);
-  }
+  g_free(default_bitmap_directory);
   default_bitmap_directory = string;
 
   return SCM_BOOL_T;
@@ -942,9 +916,7 @@ SCM g_rc_bus_ripper_symname(SCM scmsymname)
   SCM_ASSERT (scm_is_string (scmsymname), scmsymname,
               SCM_ARG1, "bus-ripper-symname");
 
-  if (default_bus_ripper_symname) {
-    g_free(default_bus_ripper_symname);
-  }
+  g_free(default_bus_ripper_symname);
   default_bus_ripper_symname = g_strdup (SCM_STRING_CHARS (scmsymname));
 
   return SCM_BOOL_T;
@@ -962,9 +934,7 @@ SCM g_rc_postscript_prolog(SCM scmsymname)
   SCM_ASSERT (scm_is_string (scmsymname), scmsymname,
               SCM_ARG1, "postsript-prolog");
 
-  if (default_postscript_prolog) {
-    g_free(default_postscript_prolog);
-  }
+  g_free(default_postscript_prolog);
 
   /* take care of any shell variables */
   default_postscript_prolog =
@@ -1105,9 +1075,7 @@ SCM g_rc_always_promote_attributes(SCM scmsymname)
   SCM_ASSERT (scm_is_string (scmsymname), scmsymname,
               SCM_ARG1, "always-promote-attributes");
 
-  if (default_always_promote_attributes) {
-    g_free(default_always_promote_attributes);
-  }
+  g_free(default_always_promote_attributes);
   default_always_promote_attributes = 
     g_strdup_printf(" %s ", SCM_STRING_CHARS (scmsymname));
 
diff --git a/libgeda/src/g_smob.c b/libgeda/src/g_smob.c
index 644e874..ca2527e 100644
--- a/libgeda/src/g_smob.c
+++ b/libgeda/src/g_smob.c
@@ -136,8 +136,8 @@ SCM g_get_attrib_name_value(SCM attrib_smob)
                             &name, &value );
     returned = scm_cons (scm_makfrom0str (name),
                          scm_makfrom0str (value));
-    if (name) g_free(name);
-    if (value) g_free(value);
+    g_free(name);
+    g_free(value);
   }
 
   return returned;
@@ -189,8 +189,8 @@ SCM g_set_attrib_value_internal(SCM attrib_smob, SCM scm_value,
     *world = attribute->world;
     *o_attrib = attribute->attribute->object;
 
-    if (name) g_free(name);
-    if (old_value) g_free(old_value);
+    g_free(name);
+    g_free(old_value);
   }
 
   return SCM_UNDEFINED;
diff --git a/libgeda/src/i_vars.c b/libgeda/src/i_vars.c
index 507714f..b79649d 100644
--- a/libgeda/src/i_vars.c
+++ b/libgeda/src/i_vars.c
@@ -28,9 +28,7 @@
 
 /*! \def INIT_STR(w, name, str) */
 #define INIT_STR(w, name, str) {                                        \
-        if ((w)->name) {                                                \
-                g_free((w)->name);                                      \
-        }                                                               \
+        g_free((w)->name);                                              \
         (w)->name = g_strdup(((default_ ## name) != NULL) ?             \
                              (default_ ## name) : (str));               \
 }
diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index e54c5ba..e26a20e 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -655,9 +655,7 @@ int o_attrib_get_name_value(char *string, char **name_ptr, char **value_ptr )
  */
 void o_attrib_free_current(TOPLEVEL *toplevel)
 {
-  if (toplevel->current_attribute) {
-    g_free(toplevel->current_attribute);
-  }
+  g_free(toplevel->current_attribute);
   toplevel->current_attribute=NULL;
 }
 
@@ -805,8 +803,8 @@ char *o_attrib_search_name(OBJECT *list, char *name, int counter)
                   return_string = (char *) 
                     g_malloc(sizeof(char)*strlen(found_value)+1);
                   strcpy(return_string, found_value);
-		  if (found_name) g_free(found_name);
-		  if (found_value) g_free(found_value);
+		  g_free(found_name);
+		  g_free(found_value);
                   return(return_string);
                 }
               }
@@ -828,8 +826,8 @@ char *o_attrib_search_name(OBJECT *list, char *name, int counter)
     /* search for attributes outside */
 
     if (o_current->type == OBJ_TEXT) {
-      if (found_name) g_free(found_name);
-      if (found_value) g_free(found_value);
+      g_free(found_name);
+      g_free(found_value);
       val = o_attrib_get_name_value(o_current->text->string, 
                                     &found_name, &found_value);
       if (val) {
@@ -840,8 +838,8 @@ char *o_attrib_search_name(OBJECT *list, char *name, int counter)
             return_string = (char *) 
               g_malloc(sizeof(char)* strlen(found_value)+1);
             strcpy(return_string, found_value);
-	    if (found_name) g_free(found_name);
-	    if (found_value) g_free(found_value);
+	    g_free(found_name);
+	    g_free(found_value);
             return(return_string);
           }
         }
@@ -853,8 +851,8 @@ char *o_attrib_search_name(OBJECT *list, char *name, int counter)
     o_current=o_current->next;
   }
 	
-  if (found_name) g_free(found_name);
-  if (found_value) g_free(found_value);
+  g_free(found_name);
+  g_free(found_value);
   return (NULL);
 } 
 
@@ -965,16 +963,16 @@ char *o_attrib_search_string_partial(OBJECT *object, char *search_for,
                                       &found_name, &found_value);
         if (val) {
           return_string = g_strdup(found_value);
-	  if (found_name) g_free(found_name);
-	  if (found_value) g_free(found_value);
+	  g_free(found_name);
+	  g_free(found_value);
 	  return(return_string);
         }
       }
     }
   }	
 	
-  if (found_name) g_free(found_name);
-  if (found_value) g_free(found_value);
+  g_free(found_name);
+  g_free(found_value);
   return (NULL);
 } 
 
@@ -1095,8 +1093,8 @@ OBJECT *o_attrib_search_attrib_value(GList *list, char *value, char *name,
               internal_counter++;	
             } else {
               if (strstr(found_name, name)) {
-		if (found_name) g_free(found_name);
-		if (found_value) g_free(found_value);
+		g_free(found_name);
+		g_free(found_value);
                 return(found);
               }
             }
@@ -1110,8 +1108,8 @@ OBJECT *o_attrib_search_attrib_value(GList *list, char *value, char *name,
     a_iter = g_list_next (a_iter);
   }
 
-  if (found_name) g_free(found_name);
-  if (found_value) g_free(found_value);
+  g_free(found_name);
+  g_free(found_value);
   return (NULL);
 } 
 
@@ -1164,8 +1162,8 @@ o_attrib_search_attrib_name(GList *list, char *name, int counter)
               return_string = (char *) 
                 g_malloc(sizeof(char)* strlen(found_value)+1);
               strcpy(return_string, found_value);
-	      if (found_name) g_free(found_name);
-	      if (found_value) g_free(found_value);
+	      g_free(found_name);
+	      g_free(found_value);
               return(return_string);
             }
           }
@@ -1177,8 +1175,8 @@ o_attrib_search_attrib_name(GList *list, char *name, int counter)
     a_iter = g_list_next (a_iter);
   }
 
-  if (found_name) g_free(found_name);
-  if (found_value) g_free(found_value);
+  g_free(found_name);
+  g_free(found_value);
   return (NULL);
 } 
 
@@ -1226,8 +1224,8 @@ char *o_attrib_search_toplevel(OBJECT *list, char *name, int counter)
             return_string = (char *) 
               g_malloc(sizeof(char)* strlen(found_value)+1);
             strcpy(return_string, found_value);
-	    if (found_name) g_free(found_name);
-	    if (found_value) g_free(found_value);
+	    g_free(found_name);
+	    g_free(found_value);
             return(return_string);
           }
         }
@@ -1239,8 +1237,8 @@ char *o_attrib_search_toplevel(OBJECT *list, char *name, int counter)
     o_current=o_current->next;
   }
 	
-  if (found_name) g_free(found_name);
-  if (found_value) g_free(found_value);
+  g_free(found_name);
+  g_free(found_value);
   return (NULL);
 } 
 
@@ -1294,8 +1292,8 @@ char *o_attrib_search_name_single(OBJECT *object, char *name,
               if (return_found) {
                 *return_found = found;
               }
-	      if (found_name) g_free(found_name);
-	      if (found_value) g_free(found_value);
+	      g_free(found_name);
+	      g_free(found_value);
               return(return_string);
             }
 	    if (found_name) { g_free(found_name); found_name = NULL; }
@@ -1315,8 +1313,8 @@ char *o_attrib_search_name_single(OBJECT *object, char *name,
   /* search for attributes outside */
 
   if (o_current->type == OBJ_TEXT) {
-    if (found_name) g_free(found_name);
-    if (found_value) g_free(found_value);
+    g_free(found_name);
+    g_free(found_value);
     val = o_attrib_get_name_value(o_current->text->string, 
                                   &found_name, &found_value);
 
@@ -1328,8 +1326,8 @@ char *o_attrib_search_name_single(OBJECT *object, char *name,
         if (return_found) {
           *return_found = o_current;
         }
-	if (found_name) g_free(found_name);
-	if (found_value) g_free(found_value);
+	g_free(found_name);
+	g_free(found_value);
         return(return_string);
       }
       if (found_name) { g_free(found_name); found_name = NULL; }
@@ -1341,8 +1339,8 @@ char *o_attrib_search_name_single(OBJECT *object, char *name,
     *return_found = NULL;
   }
   
-  if (found_name) g_free(found_name);
-  if (found_value) g_free(found_value);
+  g_free(found_name);
+  g_free(found_value);
   return (NULL);
 } 
 
@@ -1400,8 +1398,8 @@ char *o_attrib_search_name_single_count(OBJECT *object, char *name,
                 return_string = (char *) 
                   g_malloc(sizeof(char)* strlen(found_value)+1);
                 strcpy(return_string, found_value);
-		if (found_name) g_free(found_name);
-		if (found_value) g_free(found_value);
+		g_free(found_name);
+		g_free(found_value);
                 return(return_string);
               }
             }
@@ -1423,8 +1421,8 @@ char *o_attrib_search_name_single_count(OBJECT *object, char *name,
   /* search for attributes outside */
 
   if (o_current->type == OBJ_TEXT) {
-    if (found_name) g_free(found_name);
-    if (found_value) g_free(found_value);
+    g_free(found_name);
+    g_free(found_value);
     val = o_attrib_get_name_value(o_current->text->string, 
                                   &found_name, &found_value);
 
@@ -1436,8 +1434,8 @@ char *o_attrib_search_name_single_count(OBJECT *object, char *name,
           return_string = (char *) 
             g_malloc(sizeof(char)* strlen(found_value)+1);
           strcpy(return_string, found_value);
-	  if (found_name) g_free(found_name);
-	  if (found_value) g_free(found_value);
+	  g_free(found_name);
+	  g_free(found_value);
           return(return_string);
         }
       }
@@ -1446,8 +1444,8 @@ char *o_attrib_search_name_single_count(OBJECT *object, char *name,
     }
   }	
   
-  if (found_name) g_free(found_name);
-  if (found_value) g_free(found_value);
+  g_free(found_name);
+  g_free(found_value);
   return (NULL);
 } 
 
@@ -1750,9 +1748,7 @@ void o_attrib_slot_update(TOPLEVEL *toplevel, OBJECT *object)
         
         o_text_recreate(toplevel, o_pinnum_object);
       }
-      if (string) {
-      	g_free(string);
-      }
+      g_free(string);
 
       pin_counter++;
     } else {
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index 7b8f673..03cd837 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -271,8 +271,8 @@ int o_complex_is_eligible_attribute (TOPLEVEL *toplevel, OBJECT *object,
       }
       
       g_free(padded_name);
-      if (name) g_free(name);
-      if (value) g_free(value);
+      g_free(name);
+      g_free(value);
       if (promotableAttribute)
 	return TRUE;
     }
@@ -1553,7 +1553,7 @@ o_complex_check_symversion(TOPLEVEL* toplevel, OBJECT* object)
   /* if inside_value and outside_value match, then symbol versions are okay */
 
 done:
-  if (inside) g_free(inside);
-  if (outside) g_free(outside);
-  if (refdes) g_free(refdes);
+  g_free(inside);
+  g_free(outside);
+  g_free(refdes);
 }
diff --git a/libgeda/src/o_picture.c b/libgeda/src/o_picture.c
index c404dfb..9ce2595 100644
--- a/libgeda/src/o_picture.c
+++ b/libgeda/src/o_picture.c
@@ -289,9 +289,7 @@ char *o_picture_save(OBJECT *object)
 			  object->picture->embedded+0x30, 
 			  object->picture->filename);
   }
-  if (encoded_picture != NULL) {
-    g_free(encoded_picture);
-  }
+  g_free(encoded_picture);
 
   return(out);
 }
diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index e127be5..f896400 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -238,7 +238,7 @@ OBJECT *o_text_load_font(TOPLEVEL *toplevel, gunichar needed_char)
 
   o_font_set->font_prim_objs = return_head(o_font_set->font_prim_objs);
 
-  if (temp_string) g_free(temp_string);
+  g_free(temp_string);
 
   return(o_font_set->font_prim_objs);
 }
@@ -996,9 +996,9 @@ OBJECT *o_text_add(TOPLEVEL *toplevel, OBJECT *object_list,
   /* Update bounding box */
   o_text_recalc( toplevel, object_list );
 
-  if (name) g_free(name);
-  if (value) g_free(value);
-  if (output_string) g_free(output_string);
+  g_free(name);
+  g_free(value);
+  g_free(output_string);
   return(object_list);
 }
 
@@ -1362,9 +1362,9 @@ void o_text_recreate(TOPLEVEL *toplevel, OBJECT *o_current)
   o_text_recalc( toplevel, o_current );
 
   toplevel->page_current->object_parent = temp_parent;
-  if (name) g_free(name);
-  if (value) g_free(value);
-  if (output_string) g_free(output_string);
+  g_free(name);
+  g_free(value);
+  g_free(output_string);
 }
 
 /*! \todo Finish function documentation!!!
@@ -1501,7 +1501,7 @@ void o_text_print_text_width(FILE *fp, char *output_string)
     if (single_len > max_len)
     {
       max_len = strlen(single_line);
-      if (max_length_line) g_free(max_length_line);
+      g_free(max_length_line);
       max_length_line = g_strdup (single_line);
     }
   }
@@ -1521,8 +1521,8 @@ void o_text_print_text_width(FILE *fp, char *output_string)
   /* .95 is a fudge factor */
   fprintf(fp, ") stringwidth pop\n");
 
-  if (single_line) g_free(single_line);
-  if (max_length_line) g_free(max_length_line);
+  g_free(single_line);
+  g_free(max_length_line);
 }
 
 /*! \todo Finish function documentation!!!
@@ -1744,9 +1744,9 @@ void o_text_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
   fprintf(fp,"] %d %d %d %f text\n",angle,x,y,font_size);
 
   
-  if (output_string) g_free(output_string);
-  if (name) g_free(name);
-  if (value) g_free(value);
+  g_free(output_string);
+  g_free(name);
+  g_free(value);
 }
 
 
diff --git a/libgeda/src/s_attrib.c b/libgeda/src/s_attrib.c
index 8eca8f4..f0d5430 100644
--- a/libgeda/src/s_attrib.c
+++ b/libgeda/src/s_attrib.c
@@ -116,8 +116,7 @@ void s_attrib_free()
   int i;
 
   for (i = 0; i < attrib_index; i++) {
-     if (attrib[i].attrib_name)
-        g_free(attrib[i].attrib_name);
+     g_free(attrib[i].attrib_name);
   }
 
   attrib_index=0;
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 2eab043..b6169f2 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -353,45 +353,35 @@ s_delete_object(TOPLEVEL *toplevel, OBJECT *o_current)
     }
     o_current->line = NULL;
 
-    if (o_current->circle) {
-      /*	printf("sdeleting circle\n");*/
-      g_free(o_current->circle);
-    }
+    /*	printf("sdeleting circle\n");*/
+    g_free(o_current->circle);
     o_current->circle = NULL;
 
-    if (o_current->arc) {
-      /*	printf("sdeleting arc\n");*/
-      g_free(o_current->arc);
-    }
+    /*	printf("sdeleting arc\n");*/
+    g_free(o_current->arc);
     o_current->arc = NULL;
 
-    if (o_current->box) {
-      /*	printf("sdeleting box\n");*/
-      g_free(o_current->box);
-    }
+    /*	printf("sdeleting box\n");*/
+    g_free(o_current->box);
     o_current->box = NULL;
 
     if (o_current->picture) {
       /*	printf("sdeleting picture\n");*/
 
-      if (o_current->picture->file_content)
-        g_free(o_current->picture->file_content);
+      g_free(o_current->picture->file_content);
       if (o_current->picture->original_picture)
 	g_object_unref(o_current->picture->original_picture);
       if (o_current->picture->displayed_picture)
 	g_object_unref(o_current->picture->displayed_picture);
 
-      if (o_current->picture->filename)
-	g_free(o_current->picture->filename);
+      g_free(o_current->picture->filename);
       g_free(o_current->picture);
     }
     o_current->picture = NULL;
 
     if (o_current->text) {
-      if (o_current->text->string) {
-				/*printf("sdeleting text->string\n");*/
-        g_free(o_current->text->string); 
-      }
+      /*printf("sdeleting text->string\n");*/
+      g_free(o_current->text->string); 
       o_current->text->string = NULL;
 
       if (o_current->text->prim_objs) {
@@ -406,17 +396,13 @@ s_delete_object(TOPLEVEL *toplevel, OBJECT *o_current)
     }
     o_current->text = NULL;
 
-    if (o_current->name) {
-      /*	printf("sdeleting name\n");*/
-      g_free(o_current->name);
-    }
+    /*	printf("sdeleting name\n");*/
+    g_free(o_current->name);
     o_current->name = NULL;
 
 
-    if (o_current->complex_basename) {
-      /*	printf("sdeleting complex_basename\n");*/
-      g_free(o_current->complex_basename); 
-    }
+    /*	printf("sdeleting complex_basename\n");*/
+    g_free(o_current->complex_basename); 
     o_current->complex_basename = NULL;
 
     if (o_current->complex) {
diff --git a/libgeda/src/s_color.c b/libgeda/src/s_color.c
index c3028b8..6bf85f6 100644
--- a/libgeda/src/s_color.c
+++ b/libgeda/src/s_color.c
@@ -80,9 +80,7 @@ int s_color_request(int color_index, char *color_name,
 
   /* search for the color name see if it's already been alloced */
 
-  if (colors[color_index].color_name) {
-    g_free(colors[color_index].color_name);	
-  }
+  g_free(colors[color_index].color_name);	
 
   colors[color_index].color_name = g_strdup (color_name);
 
@@ -114,15 +112,9 @@ void s_color_destroy_all(void)
   int i;
 
   for (i = 0; i < MAX_COLORS; i++) {
-    if (colors[i].color_name) {
-      g_free(colors[i].color_name);
-    }
-    if (colors[i].outline_color_name) {
-      g_free(colors[i].outline_color_name);
-    }
-    if (colors[i].ps_color_string) {
-      g_free(colors[i].ps_color_string);
-    }
+    g_free(colors[i].color_name);
+    g_free(colors[i].outline_color_name);
+    g_free(colors[i].ps_color_string);
     colors[i].image_red = -1;
     colors[i].image_green = -1;
     colors[i].image_blue = -1;
diff --git a/libgeda/src/s_hierarchy.c b/libgeda/src/s_hierarchy.c
index 2e207c8..214422c 100644
--- a/libgeda/src/s_hierarchy.c
+++ b/libgeda/src/s_hierarchy.c
@@ -159,8 +159,7 @@ void s_hierarchy_down_schematic_multiple (TOPLEVEL *toplevel,
     if (found) {
       toplevel->page_current = found;
       s_page_goto(toplevel, found);
-      if (string) 
-        g_free(string);
+      g_free(string);
       return;
     }
 
@@ -181,8 +180,7 @@ void s_hierarchy_down_schematic_multiple (TOPLEVEL *toplevel,
     toplevel->page_current->up = parent->pid;
     /* toplevel->page_current->down = NULL; not needed */
 
-    if (string) 
-      g_free(string);
+    g_free(string);
 
     string = s_slib_search(filename, SLIB_SEARCH_NEXT);
   }
diff --git a/libgeda/src/s_papersizes.c b/libgeda/src/s_papersizes.c
index d2369f7..2291448 100644
--- a/libgeda/src/s_papersizes.c
+++ b/libgeda/src/s_papersizes.c
@@ -121,8 +121,7 @@ void s_papersizes_free()
   int i;
 
   for (i = 0; i < papersizes_index; i++) {
-    if (papersizes[i].papersize_name)
-      g_free(papersizes[i].papersize_name);
+    g_free(papersizes[i].papersize_name);
   }
 
   papersizes_index=0;
diff --git a/libgeda/src/s_slib.c b/libgeda/src/s_slib.c
index ac5ea74..c5b1d5d 100644
--- a/libgeda/src/s_slib.c
+++ b/libgeda/src/s_slib.c
@@ -367,8 +367,7 @@ char *s_slib_search(const char *filename, int flag)
       break;
   }
 
-  if (processed_name)
-    g_free(processed_name);
+  g_free(processed_name);
 
   /* don't forget to g_free this string */
   return(string);
@@ -408,8 +407,7 @@ void s_slib_free()
   int i;
 
   for (i = 0; i < slib_index; i++) {
-    if (slib[i].dir_name)
-      g_free(slib[i].dir_name);
+    g_free(slib[i].dir_name);
   }
 
   slib_index=0;
@@ -487,8 +485,7 @@ char *s_slib_getfiles(char *directory, int flag)
       ptr = NULL;
 
       for (j = 0 ; j < count ;j++) {
-        if (whole_dir[j]) 
-          g_free(whole_dir[j]);
+        g_free(whole_dir[j]);
       }
       count = current = 0 ;
 
@@ -505,8 +502,7 @@ char *s_slib_getfiles(char *directory, int flag)
       ptr = NULL;
 
       for (j = 0 ; j < count ;j++) {
-        if (whole_dir[j]) 
-          g_free(whole_dir[j]);
+        g_free(whole_dir[j]);
       }
       count = current = 0 ;
 
diff --git a/libgeda/src/s_undo.c b/libgeda/src/s_undo.c
index 791bcb8..5fce02d 100644
--- a/libgeda/src/s_undo.c
+++ b/libgeda/src/s_undo.c
@@ -198,7 +198,7 @@ void s_undo_destroy_all(TOPLEVEL *toplevel, UNDO *head)
 
   while (u_current != NULL) {
     u_prev = u_current->prev;	
-    if (u_current->filename) g_free(u_current->filename);
+    g_free(u_current->filename);
 		
     if (u_current->object_head) {
       s_delete_list_fromstart(toplevel,
@@ -239,9 +239,7 @@ void s_undo_remove(TOPLEVEL *toplevel, UNDO *head, UNDO *u_tos)
       else
         u_current->prev = NULL;
 
-      if (u_current->filename) {
-        g_free(u_current->filename);	
-      }
+      g_free(u_current->filename);	
 
       if (u_current->object_head) {
         s_delete_list_fromstart(toplevel,

commit ac84ca9171138a0774b4314fd8d8ee148d109474
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:55 2008 +0200

    Rewrite f_normalize_filename().
    
    Modifies f_normalize_filename() to avoid using realpath() and
    resolving symlinks. It is derived from the GNU Lib C implementation of
    realpath() with glib GString and glib portable file-related functions.

diff --git a/gattrib/src/gattrib.c b/gattrib/src/gattrib.c
index c3bdd49..60b6401 100644
--- a/gattrib/src/gattrib.c
+++ b/gattrib/src/gattrib.c
@@ -200,7 +200,13 @@ void gattrib_main(void *closure, int argc, char *argv[])
      /* Construct the list of filenames from the command line.
       * argv_index holds the position of the first filename  */
      while (argv_index < argc) {
-        file_list = g_slist_append(file_list, f_normalize_filename(argv[argv_index]));
+        gchar *filename = f_normalize_filename(argv[argv_index], NULL);
+        if (filename != NULL) {
+            file_list = g_slist_append(file_list, filename);
+        } else {
+            fprintf(stderr, "Couldn't find file [%s]\n", argv[argv_index]);
+            exit(1);
+        }
         argv_index++;
      }
   }
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 610611a..eabf6bb 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -16,7 +16,7 @@ int f_open_flags(TOPLEVEL *toplevel, const gchar *filename,
 void f_close(TOPLEVEL *toplevel);
 void f_save_close(TOPLEVEL *toplevel, char *filename);
 int f_save(TOPLEVEL *toplevel, const char *filename);
-char* f_normalize_filename(const gchar *filename);
+gchar *f_normalize_filename (const gchar *filename, GError **error);
 char *follow_symlinks (const gchar *filename, GError **error);
 
 /* f_print.c */
diff --git a/libgeda/src/f_basic.c b/libgeda/src/f_basic.c
index cfaf94b..daf0ce6 100644
--- a/libgeda/src/f_basic.c
+++ b/libgeda/src/f_basic.c
@@ -204,7 +204,13 @@ int f_open_flags(TOPLEVEL *toplevel, const gchar *filename,
   }
 
   /* get full, absolute path to file */
-  full_filename = f_normalize_filename(filename); 
+  full_filename = f_normalize_filename (filename, &tmp_err);
+  if (full_filename == NULL) {
+    g_set_error (err, G_FILE_ERROR, tmp_err->code,
+                 _("Cannot find file %s: %s"),
+                 filename, g_strerror (tmp_err->code));
+    return 0;
+  }
 
   /* write full, absolute filename into page_current->page_filename */
   if (toplevel->page_current->page_filename) {
@@ -460,33 +466,118 @@ int f_save(TOPLEVEL *toplevel, const char *filename)
   }
 }
 
-/*! \brief Reformats a filename as an absolute resolved filename
+/*! \brief Builds an absolute pathname.
  *  \par Function Description
- *  Given a filename in any format, this returns the full, absolute
- *  resolved filename.
+ *  This function derives an absolute pathname for the pathname
+ *  pointed to by \a name with '.' and '..' resolved. It does not
+ *  resolve symbolic links.
+ *
+ *  It returns NULL and sets the \a error (if not NULL) if it failed
+ *  to build the pathname or the pathname does not exists.
+ *
+ *  \note
+ *  The code for this function is derived from the realpath() of
+ *  the GNU C Library (Copyright (C) 1996-2002, 2004, 2005, 2006 Free
+ *  Software Foundation, Inc. / LGPL 2.1 or later).
  *
- *  \param [in] filename  A character string containing the file
- *                        name to resolve.
- *  \return A character string with the resolved filename.
+ *  The part for the resolution of symbolic links has been discarded
+ *  and it has been adapted for glib and for use on Windows.
+ *
+ *  \param [in]     name  A character string containing the pathname
+ *                        to resolve.
+ *  \param [in,out] error Return location for a GError, or NULL.
+ *  \return A newly-allocated string with the resolved absolute
+ *  pathname on success, NULL otherwise.
  */
-char* f_normalize_filename(const gchar *filename)
+gchar *f_normalize_filename (const gchar *name, GError **error)
 {
-  char filename_buffer[MAXPATHLEN];  /* nasty hack for realpath */
-  char *full_filename;
+#ifdef G_OS_WIN32
+#define ROOT_MARKER_LEN 3
+#else
+#define ROOT_MARKER_LEN 1
+#endif /* G_OS_WIN32 */   
+  GString *rpath;
+  const char *start, *end;
+  
+  if (name == NULL) {
+    g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_INVAL,
+                 g_strerror (EINVAL));
+    return NULL;
+  }
 
-  /*  Check for pathological case  */
-  if (filename == NULL) {
+  if (*name == '\0') {
+    g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_NOENT,
+                 g_strerror (ENOENT));
     return NULL;
   }
 
-  realpath(filename, filename_buffer);  /* places reult in filename_buffer */
-  full_filename = g_strdup (filename_buffer);
+  rpath = g_string_sized_new (strlen (name));
+  
+  /* if relative path, prepend current dir */
+  if (!g_path_is_absolute (name)) {
+    gchar *cwd = g_get_current_dir ();
+    g_string_append (rpath, cwd);
+    g_free (cwd);
+    if (!G_IS_DIR_SEPARATOR (rpath->str[rpath->len - 1])) {
+      g_string_append_c (rpath, G_DIR_SEPARATOR);
+    }
+  } else {
+    g_string_append_len (rpath, name, ROOT_MARKER_LEN);
+    /* move to first path separator */
+    name += ROOT_MARKER_LEN - 1;
+  }
 
-#ifdef DEBUG
-  printf("In f_normalize_filename, returning full_filename= %s \n", full_filename);
-#endif 
+  for (start = end = name; *start != '\0'; start = end) {
+    /* skip sequence of multiple path-separators */
+    while (G_IS_DIR_SEPARATOR (*start)) {
+      ++start;
+    }
+
+    /* find end of path component */
+    for (end = start; *end != '\0' && !G_IS_DIR_SEPARATOR (*end); ++end);
+
+    if (end - start == 0) {
+      break;
+    } else if (end - start == 1 && start[0] == '.') {
+      /* nothing */;
+    } else if (end - start == 2 && start[0] == '.' && start[1] == '.') {
+      /* back up to previous component, ignore if at root already.  */
+      if (rpath->len > ROOT_MARKER_LEN) {
+        while (!G_IS_DIR_SEPARATOR (rpath->str[(--rpath->len) - 1]));
+        g_string_set_size (rpath, rpath->len);
+      }
+    } else {
+      /* path component, copy to new path */
+      if (!G_IS_DIR_SEPARATOR (rpath->str[rpath->len - 1])) {
+        g_string_append_c (rpath, G_DIR_SEPARATOR);
+      }
+
+      g_string_append_len (rpath, start, end - start);
+
+      if (!g_file_test (rpath->str, G_FILE_TEST_EXISTS)) {
+        g_set_error (error,G_FILE_ERROR, G_FILE_ERROR_NOENT,
+                     g_strerror (ENOENT));
+        goto error;
+      } else if (!g_file_test (rpath->str, G_FILE_TEST_IS_DIR) &&
+                 *end != '\0') {
+        g_set_error (error,G_FILE_ERROR, G_FILE_ERROR_NOTDIR,
+                     g_strerror (ENOTDIR));
+        goto error;
+      }
+    }
+  }
+  
+  if (G_IS_DIR_SEPARATOR (rpath->str[rpath->len - 1]) &&
+      rpath->len > ROOT_MARKER_LEN) {
+    g_string_set_size (rpath, rpath->len - 1);
+  }
+  
+  return g_string_free (rpath, FALSE);
 
-  return full_filename;
+  error:
+  g_string_free (rpath, TRUE);
+  return NULL;
+#undef ROOT_MARKER_LEN
 }
 
 /*! \brief Follow symlinks until a real file is found
diff --git a/libgeda/src/g_basic.c b/libgeda/src/g_basic.c
index 1cfd062..540761d 100644
--- a/libgeda/src/g_basic.c
+++ b/libgeda/src/g_basic.c
@@ -273,7 +273,7 @@ int g_read_file(const gchar *filename)
 	}
 
 	/* get full, absolute path to file */
-	full_filename = f_normalize_filename(filename);
+	full_filename = f_normalize_filename (filename, NULL);
 	if (full_filename == NULL) {
 		return(-1);
 	}
diff --git a/libgeda/src/g_rc.c b/libgeda/src/g_rc.c
index a0472ab..5fb2f8e 100644
--- a/libgeda/src/g_rc.c
+++ b/libgeda/src/g_rc.c
@@ -203,7 +203,7 @@ gint g_rc_parse_system_rc(TOPLEVEL *toplevel, const gchar *rcname)
                      G_DIR_SEPARATOR_S,
                      "system-", rcname,
                      NULL);
-  filename = f_normalize_filename(tmp);
+  filename = f_normalize_filename (tmp, NULL);
   if (filename == NULL) {
     return 0;
   }
@@ -248,7 +248,7 @@ gint g_rc_parse_home_rc(TOPLEVEL *toplevel, const gchar *rcname)
                      G_DIR_SEPARATOR_S,
                      rcname,
                      NULL);
-  filename = f_normalize_filename(tmp);
+  filename = f_normalize_filename (tmp, NULL);
   if (filename == NULL) {
     return 0;
   }
@@ -284,7 +284,7 @@ gint g_rc_parse_local_rc(TOPLEVEL *toplevel, const gchar *rcname)
   gchar *err_msg;
 
   tmp = g_strconcat (".", G_DIR_SEPARATOR_S, rcname, NULL);
-  filename = f_normalize_filename (tmp);
+  filename = f_normalize_filename (tmp, NULL);
   if (filename == NULL) {
     return 0;
   }
@@ -323,7 +323,10 @@ gint g_rc_parse_specified_rc(TOPLEVEL *toplevel, const gchar *rcname)
     return 0;
   }
 
-  filename = f_normalize_filename (rcname);
+  filename = f_normalize_filename (rcname, NULL);
+  if (filename == NULL) {
+    return 0;
+  }
 
   rcbasename = g_path_get_basename (rcname);
 
@@ -362,7 +365,7 @@ void g_rc_parse(TOPLEVEL *toplevel,
 
   /* set the GEDADATARC environment variable so that the rc files */
   /* know where to look for others */
-  rc_path = f_normalize_filename (g_rc_parse_path ());
+  rc_path = f_normalize_filename (g_rc_parse_path (), NULL);
 
   g_setenv ("GEDADATARC", rc_path, TRUE);
   g_free (rc_path);
diff --git a/libgeda/src/s_hierarchy.c b/libgeda/src/s_hierarchy.c
index 116b652..2e207c8 100644
--- a/libgeda/src/s_hierarchy.c
+++ b/libgeda/src/s_hierarchy.c
@@ -75,7 +75,7 @@ int s_hierarchy_down_schematic_single(TOPLEVEL *toplevel,
   switch (flag) {
     case HIERARCHY_NORMAL_LOAD:
     {
-      gchar *filename = f_normalize_filename (string);
+      gchar *filename = f_normalize_filename (string, NULL);
       found = s_page_search (toplevel, filename);
       g_free (filename);
       

commit 2800c05634d2c66f586adc1dd0430b0d069686de
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:54 2008 +0200

    Rewrite s_expand_env_variables() with glib GString.

diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index ee78204..610611a 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -347,9 +347,7 @@ void string_tolower(char *in, char *out);
 int colornametovalue(char *string);
 char *remove_nl(char *string);
 char *remove_last_nl(char *string);
-char *remove_string(char *string, int start, int end);
-char *insert_string(char *string, int start, char *insert_string);
-char *s_expand_env_variables(char *string);
+gchar *s_expand_env_variables (const gchar *string);
 
 /* s_clib.c */
 void s_clib_free (void);
diff --git a/libgeda/src/g_rc.c b/libgeda/src/g_rc.c
index 6e91098..a0472ab 100644
--- a/libgeda/src/g_rc.c
+++ b/libgeda/src/g_rc.c
@@ -401,7 +401,7 @@ void g_rc_parse(TOPLEVEL *toplevel,
  */
 SCM g_rc_component_library(SCM path, SCM name)
 {
-  char *string;
+  gchar *string;
   char *namestr = NULL;
 
   SCM_ASSERT (scm_is_string (path), path,
@@ -413,9 +413,8 @@ SCM g_rc_component_library(SCM path, SCM name)
     namestr = SCM_STRING_CHARS (name);
   }
   
-  string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = s_expand_env_variables(string);
+  string = s_expand_env_variables (SCM_STRING_CHARS (path));
 
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -460,40 +459,36 @@ SCM g_rc_component_library(SCM path, SCM name)
 SCM g_rc_component_library_command (SCM listcmd, SCM getcmd, 
                                     SCM name)
 {
-  gchar *namestr = NULL;
-  gchar *lcmdstr = NULL;
-  gchar *gcmdstr = NULL;
   const CLibSource *src;
-  char *tmp_str;
+  gchar *lcmdstr, *gcmdstr;
+  char *tmp_str, *namestr;
 
   SCM_ASSERT (scm_is_string (listcmd), listcmd, SCM_ARG1, 
               "component-library-command");
-  tmp_str = scm_to_locale_string (listcmd);
-  lcmdstr = g_strdup (tmp_str);
-  free (tmp_str); /* this should stay as free (allocated from guile) */
-
   SCM_ASSERT (scm_is_string (getcmd), getcmd, SCM_ARG2, 
               "component-library-command");
-  tmp_str = scm_to_locale_string (getcmd);
-  gcmdstr = g_strdup (tmp_str);
-  free (tmp_str); /* this should stay as free (allocated from guile) */
-
   SCM_ASSERT (scm_is_string (name), name, SCM_ARG3, 
               "component-library-command");
-  tmp_str = scm_to_locale_string (name);
-  namestr = g_strdup (tmp_str);
+
+  /* take care of any shell variables */
+  /*! \bug this may be a security risk! */
+  tmp_str = scm_to_locale_string (listcmd);
+  lcmdstr = s_expand_env_variables (tmp_str);
   free (tmp_str); /* this should stay as free (allocated from guile) */
 
   /* take care of any shell variables */
   /*! \bug this may be a security risk! */
-  lcmdstr = s_expand_env_variables(lcmdstr);
-  gcmdstr = s_expand_env_variables(gcmdstr);
+  tmp_str = scm_to_locale_string (getcmd);
+  gcmdstr = s_expand_env_variables (tmp_str);
+  free (tmp_str); /* this should stay as free (allocated from guile) */
+
+  namestr = scm_to_locale_string (name);
 
   src = s_clib_add_command (lcmdstr, gcmdstr, namestr);
 
+  free (namestr); /* this should stay as free (allocated from guile) */
   g_free (lcmdstr);
   g_free (gcmdstr);
-  g_free (namestr);
 
   if (src != NULL) return SCM_BOOL_T;
 
@@ -541,16 +536,15 @@ SCM g_rc_component_library_funcs (SCM listfunc, SCM getfunc, SCM name)
  */
 SCM g_rc_component_library_search(SCM path)
 {
-  char *string;
+  gchar *string;
   GDir *dir;
   const gchar *entry;
   
   SCM_ASSERT (scm_is_string (path), path,
               SCM_ARG1, "component-library-search");
 
-  string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = s_expand_env_variables(string);
+  string = s_expand_env_variables (SCM_STRING_CHARS (path));
 
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -619,14 +613,13 @@ SCM g_rc_component_library_search(SCM path)
  */
 SCM g_rc_source_library(SCM path)
 {
-  char *string;
+  gchar *string;
   
   SCM_ASSERT (scm_is_string (path), path,
               SCM_ARG1, "source-library");
 
-  string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = s_expand_env_variables(string);
+  string = s_expand_env_variables (SCM_STRING_CHARS (path));
   
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -670,16 +663,15 @@ SCM g_rc_source_library(SCM path)
  */
 SCM g_rc_source_library_search(SCM path)
 {
-  char *string;
+  gchar *string;
   GDir *dir;
   const gchar *entry;
   
   SCM_ASSERT (scm_is_string (path), path,
               SCM_ARG1, "source-library-search");
 
-  string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = s_expand_env_variables(string);
+  string = s_expand_env_variables (SCM_STRING_CHARS (path));
 
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -836,14 +828,13 @@ SCM g_rc_untitled_name(SCM name)
  */
 SCM g_rc_font_directory(SCM path)
 {
-  char *string;
+  gchar *string;
 
   SCM_ASSERT (scm_is_string (path), path,
               SCM_ARG1, "font-directory");
 
-  string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = s_expand_env_variables(string);
+  string = s_expand_env_variables (SCM_STRING_CHARS (path));
 
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -873,14 +864,13 @@ SCM g_rc_font_directory(SCM path)
  */
 SCM g_rc_scheme_directory(SCM path)
 {
-  char *string;
+  gchar *string;
 
   SCM_ASSERT (scm_is_string (path), path,
               SCM_ARG1, "scheme-directory");
 
-  string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = s_expand_env_variables(string);
+  string = s_expand_env_variables (SCM_STRING_CHARS (path));
 
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -910,14 +900,13 @@ SCM g_rc_scheme_directory(SCM path)
  */
 SCM g_rc_bitmap_directory(SCM path)
 {
-  char *string;
+  gchar *string;
 
   SCM_ASSERT (scm_is_string (path), path,
               SCM_ARG1, "bitmap-directory");
   
-  string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = s_expand_env_variables(string);
+  string = s_expand_env_variables (SCM_STRING_CHARS (path));
 
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -967,8 +956,6 @@ SCM g_rc_bus_ripper_symname(SCM scmsymname)
  */
 SCM g_rc_postscript_prolog(SCM scmsymname)
 {
-  char *string;
-  
   SCM_ASSERT (scm_is_string (scmsymname), scmsymname,
               SCM_ARG1, "postsript-prolog");
 
@@ -976,11 +963,9 @@ SCM g_rc_postscript_prolog(SCM scmsymname)
     g_free(default_postscript_prolog);
   }
 
-  string = g_strdup (SCM_STRING_CHARS (scmsymname));
   /* take care of any shell variables */
-  string = s_expand_env_variables(string);
-
-  default_postscript_prolog = g_strdup (string);
+  default_postscript_prolog =
+    s_expand_env_variables (SCM_STRING_CHARS (scmsymname));
 
   return SCM_BOOL_T;
 }
@@ -1042,7 +1027,7 @@ SCM g_rc_map_font_character_to_file(SCM scmcharstr, SCM scmfilename)
   }
 
   /* take care of expansion of any shell variables in filename */
-  filename = s_expand_env_variables (g_strdup (filename));
+  filename = s_expand_env_variables (filename);
 
   character = g_utf8_get_char_validated (charstr, -1);
   
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 3e4fdf7..2eab043 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -680,229 +680,99 @@ void vsnprintf(char *buff, size_t bufsiz, const char *fmt, va_list ap)
 }
 #endif
 
-/*! \todo Finish function documentation!!!
- *  \brief
+/*! \brief Expand environment variables in string.
  *  \par Function Description
+ *  This function returns the passed string with environment variables
+ *  expanded.
  *
- */
-/* this function is called by s_expand_env_variables */
-/* changes and returns new string, frees the one that was passed in */
-char *remove_string(char *string, int start, int end) 
-{
-  char *return_string;
-  int i;
-  int len;
-  int j;
-
-  if (!string) {
-    return(NULL);
-  }
-
-  len = strlen(string);
-
-  return_string = (char *) g_malloc(sizeof(char)*(len+1));
-
-  j = 0;
-  for (i = 0 ; i < len; i++) {
-    if (i >= start && i <= end) {
-      /* do nothing */
-      /* removing characters */
-    } else {
-      return_string[j] = string[i];
-      j++;
-    }
-  }
-  return_string[j] = '\0';
-
-  /* free original string */
-  g_free(string);
-
-  return(return_string);
-}
-
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
+ *  The invocations of environment variable MUST be in the form
+ *  '${variable_name}', '$variable_name' is not valid here. Environment
+ *  variable names consists solely of letters, digits and '_'. It is
+ *  possible to escape a '$' character in the string by repeating it
+ *  twice.
+ *
+ *  It outputs error messages to console and leaves the malformed and
+ *  bad variable names in the returned string.
  *
+ *  \param [in] string The string with variables to expand.
+ *  \return A newly-allocated string with variables expanded or NULL
+ *  if input string was NULL.
  */
-/* this function is called by s_expand_env_variables */
-/* changes and returns new string, frees the one that was passed in */
-char *insert_string(char *string, int start, char *insert_string)
+gchar*
+s_expand_env_variables (const gchar *string)
 {
-  char *new_string=NULL;
-  int i;
-  int len;
-  int insert_len;
-  int total_len;
-  int j;
-  int orig_count=0;
-
-  /* this should never happen */
-  if (!insert_string) {
-    return(NULL);	
-  }
+  GString *gstring;
+  gint i;
 
-  /* this should never happen either */
-  if (!string) {
-    return(NULL);	
+  if (string == NULL) {
+    return NULL;
   }
 
-  len = strlen(string);
-  insert_len = strlen(insert_string);
-  total_len = len+insert_len;
-
-  new_string = (char *) g_malloc(sizeof(char)*(total_len+1));
-
+  gstring = g_string_sized_new (strlen (string));
   i = 0;
-  while (i < total_len) {
-    if (i == start) {
-      for (j = 0 ; j < insert_len; j++) {
-        new_string[i+j] = insert_string[j];
-      }
-      i = j+i;
-    } else {
-      new_string[i] = string[orig_count];
-      i++;
-      orig_count++;
+  while (TRUE) {
+    gint start;
+
+    start = i;
+    /* look for end of string or possible variable name start */
+    while (string[i] != '\0' && string[i] != '$') i++;
+    g_string_append_len (gstring, string + start, i - start);
+    if (string[i] == '\0') {
+      /* end of string, return built string */
+      return g_string_free (gstring, FALSE);
     }
-  }
-
-  new_string[i] = '\0';
-
-  /* now free the original string */
-  g_free(string);
-
-  return(new_string);
-}
 
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-/* this function changes and then returns the string which has the 
- * expanded environment variables, frees passed in string */
-/* Environment variables MUST be in the form ${variable_name} */
-/* $variable_name is not valid here */
-char *s_expand_env_variables(char *string)
-{
-  char wanted_var[80]; /* size is hack */
-  char *return_string=NULL;
-  char *environment_string=NULL;
-  int changed=1;
-  int found_dollar=0;
-  int found_lbrac=0; 
-  int found_rbrac=0;
-  int start_of_variable= -1;
-  int end_of_variable= -1;
-  int count=0;
-  int i,j;
-
-  if (!string) {
-    return(NULL);
-  }
-
-  return_string = string;	
-
-  while(changed) {
-	
-    changed=0;
-    j=0;
-    for (i = 0 ; i < strlen(return_string); i++) {
-
-      switch(return_string[i]) {
-
-        case('$'):
-
-#if DEBUG
-          printf("found a $\n");
-#endif
-          found_dollar=1;	
-          start_of_variable=i;
-          break;
-
-        case('{'):
-          if (found_dollar) {
-            found_lbrac=1;
-            count=1;
+    i++;
+    switch (string[i]) {
+        case ('{'):
+          /* look for the end of the variable name */
+          start = i;
+          while (string[i] != '\0' && string[i] != '}') i++;
+          if (string[i] == '\0') {
+            /* problem: no closing '}' to variable */
+            fprintf (stderr,
+                     "Found malformed environment variable in '%s'\n",
+                     string);
+            g_string_append (gstring, "$");
+            g_string_append_len (gstring, string + start, i - start + 1);
+          } else {
+            gint j;
+
+            /* discard "${" */
+            start = start + 1;
+            /* test characters of variable name */
+            for (j = start;
+                 j < i && (g_ascii_isalnum (string[j]) || string[j] == '_');
+                 j++);
+            if (i != j) {
+              /* illegal character detected in variable name */
+              fprintf (stderr,
+                       "Found bad character [%c] in variable name.\n",
+                       string[j]);
+              g_string_append (gstring, "${");
+              g_string_append_len (gstring, string + start, i - start + 1);
+            } else {
+              /* extract variable name from string and expand it */
+              gchar *variable_name = g_strndup (string + start, i - start);
+              const gchar *env = g_getenv (variable_name);
+              g_free (variable_name);
+              g_string_append (gstring, (env == NULL) ? "" : env);
+            }
+            i++;
           }
           break;
 
-        case('}'):
-          if (found_dollar) {
-            found_rbrac=1;
-            /* ends filling of wanted_var */	
-            found_lbrac=0;
-            end_of_variable=i;
-          }
+        case ('$'):
+          /* an escaped '$' */
+          g_string_append_c (gstring, string[i++]);
           break;
-
-      }
-
-      /* the > 1 bit is so that we don't store the { */
-      if (found_dollar && found_lbrac && (count > 1)) {
-        wanted_var[j] = return_string[i];
-        j++; /* check for size */
-      }
-
-      /* skip over initial { */ 
-      count++;
-
-      if (found_rbrac && !found_lbrac) {
-        wanted_var[j] = '\0';
-#if DEBUG
-        printf("variable wanted: _%s_\n",  wanted_var);
-        printf("Between index: %d and %d\n", 
-               start_of_variable,
-               end_of_variable);
-#endif
-
-		
-        environment_string = getenv(wanted_var);	
-
-#if DEBUG
-        if (environment_string) {
-          printf("%s = _%s_\n", wanted_var, 
-                 environment_string);
-        }
-#endif
-
-        return_string = remove_string(return_string,
-                                      start_of_variable,
-                                      end_of_variable);
-
-#if DEBUG
-        printf("removed string: _%s_\n", return_string);
-#endif
-
-        if (environment_string) {
-          return_string = insert_string(
-                                        return_string,
-                                        start_of_variable,
-                                        environment_string);
-
-        }
-
-#if DEBUG
-        printf("final string: _%s_\n", return_string);
-#endif
-        changed=1;
-
-				/* end of search */
-        found_dollar=0;
-        found_rbrac=0;
-        count=0;
-        start_of_variable= -1;
-        end_of_variable= -1;
-
-        break;
-      }
+          
+        default:
+          /* an isolated '$', put it in output */
+          g_string_append_c (gstring, '$');
     }
   }
 
-  if (found_dollar) {
-    fprintf(stderr, "Found malformed environment variable (use ${varname})!\n");
-  }
-
-  return(return_string);
+  /* never reached */
+  return NULL;
 }

commit c1b6775eb651c3e576eb50d9d676cf179e0b2b21
Author: Patrick Bernaud <b-patrick@xxxxxxxxxx>
Date:   Fri Jul 11 16:02:53 2008 +0200

    Rename expand_env_variables() to s_expand_env_variables().

diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index bbd3c68..ee78204 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -349,7 +349,7 @@ char *remove_nl(char *string);
 char *remove_last_nl(char *string);
 char *remove_string(char *string, int start, int end);
 char *insert_string(char *string, int start, char *insert_string);
-char *expand_env_variables(char *string);
+char *s_expand_env_variables(char *string);
 
 /* s_clib.c */
 void s_clib_free (void);
diff --git a/libgeda/src/g_rc.c b/libgeda/src/g_rc.c
index 2e4338e..6e91098 100644
--- a/libgeda/src/g_rc.c
+++ b/libgeda/src/g_rc.c
@@ -415,7 +415,7 @@ SCM g_rc_component_library(SCM path, SCM name)
   
   string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = expand_env_variables(string);
+  string = s_expand_env_variables(string);
 
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -486,8 +486,8 @@ SCM g_rc_component_library_command (SCM listcmd, SCM getcmd,
 
   /* take care of any shell variables */
   /*! \bug this may be a security risk! */
-  lcmdstr = expand_env_variables(lcmdstr);
-  gcmdstr = expand_env_variables(gcmdstr);
+  lcmdstr = s_expand_env_variables(lcmdstr);
+  gcmdstr = s_expand_env_variables(gcmdstr);
 
   src = s_clib_add_command (lcmdstr, gcmdstr, namestr);
 
@@ -550,7 +550,7 @@ SCM g_rc_component_library_search(SCM path)
 
   string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = expand_env_variables(string);
+  string = s_expand_env_variables(string);
 
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -626,7 +626,7 @@ SCM g_rc_source_library(SCM path)
 
   string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = expand_env_variables(string);
+  string = s_expand_env_variables(string);
   
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -679,7 +679,7 @@ SCM g_rc_source_library_search(SCM path)
 
   string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = expand_env_variables(string);
+  string = s_expand_env_variables(string);
 
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -843,7 +843,7 @@ SCM g_rc_font_directory(SCM path)
 
   string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = expand_env_variables(string);
+  string = s_expand_env_variables(string);
 
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -880,7 +880,7 @@ SCM g_rc_scheme_directory(SCM path)
 
   string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = expand_env_variables(string);
+  string = s_expand_env_variables(string);
 
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -917,7 +917,7 @@ SCM g_rc_bitmap_directory(SCM path)
   
   string = g_strdup (SCM_STRING_CHARS (path));
   /* take care of any shell variables */
-  string = expand_env_variables(string);
+  string = s_expand_env_variables(string);
 
   /* invalid path? */
   if (!g_file_test (string, G_FILE_TEST_IS_DIR)) {
@@ -978,7 +978,7 @@ SCM g_rc_postscript_prolog(SCM scmsymname)
 
   string = g_strdup (SCM_STRING_CHARS (scmsymname));
   /* take care of any shell variables */
-  string = expand_env_variables(string);
+  string = s_expand_env_variables(string);
 
   default_postscript_prolog = g_strdup (string);
 
@@ -1042,7 +1042,7 @@ SCM g_rc_map_font_character_to_file(SCM scmcharstr, SCM scmfilename)
   }
 
   /* take care of expansion of any shell variables in filename */
-  filename = expand_env_variables (g_strdup (filename));
+  filename = s_expand_env_variables (g_strdup (filename));
 
   character = g_utf8_get_char_validated (charstr, -1);
   
diff --git a/libgeda/src/s_basic.c b/libgeda/src/s_basic.c
index 837561b..3e4fdf7 100644
--- a/libgeda/src/s_basic.c
+++ b/libgeda/src/s_basic.c
@@ -685,7 +685,7 @@ void vsnprintf(char *buff, size_t bufsiz, const char *fmt, va_list ap)
  *  \par Function Description
  *
  */
-/* this function is called by expand_env_variables */
+/* this function is called by s_expand_env_variables */
 /* changes and returns new string, frees the one that was passed in */
 char *remove_string(char *string, int start, int end) 
 {
@@ -725,7 +725,7 @@ char *remove_string(char *string, int start, int end)
  *  \par Function Description
  *
  */
-/* this function is called by expand_env_variables */
+/* this function is called by s_expand_env_variables */
 /* changes and returns new string, frees the one that was passed in */
 char *insert_string(char *string, int start, char *insert_string)
 {
@@ -784,7 +784,7 @@ char *insert_string(char *string, int start, char *insert_string)
  * expanded environment variables, frees passed in string */
 /* Environment variables MUST be in the form ${variable_name} */
 /* $variable_name is not valid here */
-char *expand_env_variables(char *string)
+char *s_expand_env_variables(char *string)
 {
   char wanted_var[80]; /* size is hack */
   char *return_string=NULL;




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs