summaryrefslogtreecommitdiff
path: root/app/wlib/gtklib/opendocument.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2024-07-03 10:19:30 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2024-07-03 10:19:30 +0200
commita14a7a0ccc9de76aeab0b2e4bbf58f1a79deedc2 (patch)
treee469179df67a0e0db49161a43cbf8076a189f6f4 /app/wlib/gtklib/opendocument.c
parent5d2c2b27a6323e2666378b986129b2a7c2c39e5c (diff)
New upstream version 5.3.0GAupstream/5.3.0GAupstream
Diffstat (limited to 'app/wlib/gtklib/opendocument.c')
-rw-r--r--app/wlib/gtklib/opendocument.c88
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);
}