From 0650daaaac9c310117b8962647ad6e7b494edebe Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sun, 21 Feb 2010 17:56:25 +0000 Subject: Fixed silly deletion in Demo.cxx git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7129 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/demo.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/demo.cxx b/test/demo.cxx index dd1f5ec11..7900df413 100644 --- a/test/demo.cxx +++ b/test/demo.cxx @@ -422,16 +422,17 @@ int load_the_menu(const char* fname) { #if defined ( __APPLE__ ) // mac os bundle menu detection: - char* pos = strrchr(fname,'/'); - if (!pos) return 0; - *pos='\0'; - pos = strrchr(fname,'/'); - if (!pos) return 0; - strcpy(pos,"/Resources/demo.menu"); - fin = fopen(fname,"r"); - if (fin == NULL) + char* pos = strrchr(fname,'/'); + if (!pos) return 0; + *pos='\0'; + pos = strrchr(fname,'/'); + if (!pos) return 0; + strcpy(pos,"/Resources/demo.menu"); + fin = fopen(fname,"r"); #endif } + // if "fin" is still NULL, we will read the menu from the string array in the + // beginning of the file. for (;;) { if (fin) { if (fgets(line,256,fin) == NULL) break; -- cgit v1.2.3