diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-07-03 10:19:36 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-07-03 10:19:36 +0200 |
commit | b6bd52cd7330a90fc0e44dbe6022551a8dd768a1 (patch) | |
tree | 9804282102f8c40d27407b9c94119b35eeb5013c /app/wlib/gtklib/opendocument.c | |
parent | c9d0740841fbe0539e42e66d3865672bfcd3ac02 (diff) | |
parent | a14a7a0ccc9de76aeab0b2e4bbf58f1a79deedc2 (diff) |
Update upstream source from tag 'upstream/5.3.0GA'
Update to upstream version '5.3.0GA'
with Debian dir dfd14d63b0238e276ade6f54dd9100325df5b2f9
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); } |