From 635efa35743022a87d0eccf0509562e83fa86c0d Mon Sep 17 00:00:00 2001 From: Maksym Veremeyenko Date: Sat, 18 Jun 2011 11:56:09 +0300 Subject: [PATCH 1/1] cleanup path before readlink, add devel case for pixmaps path detection --- src/main.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/main.c b/src/main.c index 48e1ece..0b775f4 100644 --- a/src/main.c +++ b/src/main.c @@ -49,6 +49,7 @@ int main( int argc, char *argv[] ) gtk_init( &argc, &argv ); // Linux hack to determine path of the executable + memset(path, 0, sizeof(path)); readlink( "/proc/self/exe", path, 512 ); if ( strstr( path, "/bin/rugen" ) ) { @@ -56,6 +57,12 @@ int main( int argc, char *argv[] ) strcat( path, "/share/rugen/pixmaps" ); add_pixmap_directory( path ); } + else if ( strstr( path, "/src/rugen" ) ) + { + ( *strstr( path, "/src/rugen" ) ) = '\0'; + strcat( path, "/pixmaps" ); + add_pixmap_directory( path ); + } else { add_pixmap_directory( PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps" ); -- 1.7.4.4