diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2017-10-13 14:58:30 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2017-10-13 14:58:30 +0000 |
| commit | 66b1690aa8b5d05f540ded9999c08525cd1eaf7a (patch) | |
| tree | ccb5a3a743f1e008fd4b217c619ba99faee62612 /examples | |
| parent | db83933f585d156db2ae35d9c5649bb21b4555af (diff) | |
Replace remaining calls to getenv() with fl_getenv().
... except in driver code that uses Fl_System_Driver::getenv().
Todo: Check if all remaining calls of getenv() in driver code are correct
or might use ::getenv() to avoid one calling level for optimization.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12492 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nativefilechooser-simple-app.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/nativefilechooser-simple-app.cxx b/examples/nativefilechooser-simple-app.cxx index cb35bcfd6..d206daeac 100644 --- a/examples/nativefilechooser-simple-app.cxx +++ b/examples/nativefilechooser-simple-app.cxx @@ -4,7 +4,7 @@ // An example of how to use Fl_Native_File_Chooser to open & save files. // // Copyright 2010 Greg Ercolano. -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2017 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -46,7 +46,7 @@ class Application : public Fl_Window { void save(const char *filename) { printf("Saving '%s'\n", filename); if ( !exist(filename) ) { - FILE *fp = fl_fopen(filename, "w"); // create file if it doesn't exist + FILE *fp = fl_fopen(filename, "w"); // create file if it doesn't exist if ( fp ) { // A real app would do something useful here. fprintf(fp, "Hello world.\n"); @@ -103,9 +103,9 @@ class Application : public Fl_Window { static char *filename = 0; if ( !filename ) { const char *home = - getenv("HOME") ? getenv("HOME") : // unix - getenv("HOME_PATH") ? getenv("HOME_PATH") : // windows - "."; // other + fl_getenv("HOME") ? fl_getenv("HOME") : // unix + fl_getenv("HOME_PATH") ? fl_getenv("HOME_PATH") : // windows + "."; // other filename = (char*)malloc(strlen(home)+20); sprintf(filename, "%s/untitled.txt", home); } |
