diff options
Diffstat (limited to 'app/wlib/gtklib/opendocument.c')
-rw-r--r-- | app/wlib/gtklib/opendocument.c | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/app/wlib/gtklib/opendocument.c b/app/wlib/gtklib/opendocument.c index c03f9cb..5c057ec 100644 --- a/app/wlib/gtklib/opendocument.c +++ b/app/wlib/gtklib/opendocument.c @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <stdlib.h> @@ -55,24 +55,24 @@ static char * ExtendPath(void) { - char *path = strdup(getenv("PATH")); - DynString newPath; - DynStringMalloc(&newPath, 16); + char *path = strdup(getenv("PATH")); + DynString newPath; + DynStringMalloc(&newPath, 16); - // append XTrackCAD's directory to the path as a fallback - DynStringCatCStrs(&newPath, - path, - ":", - wGetAppLibDir(), - NULL); + // append XTrackCAD's directory to the path as a fallback + DynStringCatCStrs(&newPath, + path, + ":", + wGetAppLibDir(), + NULL); - setenv("PATH", - DynStringToCStr(&newPath), - TRUE); + setenv("PATH", + DynStringToCStr(&newPath), + TRUE); - DynStringFree(&newPath); + DynStringFree(&newPath); - return (path); + return (path); } /** @@ -85,33 +85,33 @@ ExtendPath(void) unsigned wOpenFileExternal(char * filename) { - int rc; - DynString commandLine; - char *currentPath; - - assert(filename != NULL); - assert(strlen(filename)); - - currentPath = ExtendPath(); - - DynStringMalloc(&commandLine, 16); - DynStringCatCStrs(&commandLine, - DEFAULTOPENCOMMAND, - " \"", - filename, - "\"", - NULL); - - // the command should be found via the PATH - rc = system(DynStringToCStr(&commandLine)); - - // restore the PATH - setenv("PATH", - currentPath, - TRUE); - - free(currentPath); - DynStringFree(&commandLine); - - return(rc==0); + int rc; + DynString commandLine; + char *currentPath; + + assert(filename != NULL); + assert(strlen(filename)); + + currentPath = ExtendPath(); + + DynStringMalloc(&commandLine, 16); + DynStringCatCStrs(&commandLine, + DEFAULTOPENCOMMAND, + " \"", + filename, + "\"", + NULL); + + // the command should be found via the PATH + rc = system(DynStringToCStr(&commandLine)); + + // restore the PATH + setenv("PATH", + currentPath, + TRUE); + + free(currentPath); + DynStringFree(&commandLine); + + return(rc==0); } |