diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-11-14 19:35:45 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-11-14 19:35:45 +0100 |
commit | df5520aa2dae5b3ce7abf8733dcdd152898af163 (patch) | |
tree | 00d3047bfb14f682bfb5a21010c731ed649bfed7 /app/wlib/gtklib/opendocument.c | |
parent | df247efec654e512242e4f4f1b0212034f9e01fe (diff) | |
parent | ec3c0f6f6e7153fa797dc57a0e95779cbc63a23b (diff) |
Merge branch 'release/debian/1_5.3.0GA-1'HEADdebian/1_5.3.0GA-1master
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); } |