summaryrefslogtreecommitdiff
path: root/gui/LnxMain.c
diff options
context:
space:
mode:
authorSND\dario86_cp <SND\dario86_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-03-12 18:54:28 +0000
committerSND\dario86_cp <SND\dario86_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-03-12 18:54:28 +0000
commita58cfdac407bc1d8fedc11acd924b275ba28cc51 (patch)
treeb4c2e08c34ef1bfe0ba947ef8eed931c9a43fc0e /gui/LnxMain.c
parent9bdd06684bcc627c06ddcf4c406f6b48f0dfe389 (diff)
downloadpcsxr-a58cfdac407bc1d8fedc11acd924b275ba28cc51.tar.gz
Commited patch in issue #8171 (by darktjm).
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@64524 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'gui/LnxMain.c')
-rw-r--r--gui/LnxMain.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gui/LnxMain.c b/gui/LnxMain.c
index c04061c0..84800f61 100644
--- a/gui/LnxMain.c
+++ b/gui/LnxMain.c
@@ -262,7 +262,7 @@ static void ScanAllPlugins (void) {
}
// Set the default plugin name
-void set_default_plugin(char *plugin_name, char *conf_plugin_name) {
+static void set_default_plugin(char *plugin_name, char *conf_plugin_name) {
if (strlen(plugin_name) != 0) {
strcpy(conf_plugin_name, plugin_name);
printf("Picking default plugin: %s\n", plugin_name);
@@ -308,8 +308,8 @@ int main(int argc, char *argv[]) {
if (i+1 >= argc) break;
strncpy(isofilename, argv[++i], MAXPATHLEN);
if (isofilename[0] != '/') {
- getcwd(path, MAXPATHLEN);
- if (strlen(path) + strlen(isofilename) + 1 < MAXPATHLEN) {
+ if (getcwd(path, MAXPATHLEN) != NULL &&
+ strlen(path) + strlen(isofilename) + 1 < MAXPATHLEN) {
strcat(path, "/");
strcat(path, isofilename);
strcpy(isofilename, path);
@@ -340,8 +340,8 @@ int main(int argc, char *argv[]) {
} else {
strncpy(file, argv[i], MAXPATHLEN);
if (file[0] != '/') {
- getcwd(path, MAXPATHLEN);
- if (strlen(path) + strlen(file) + 1 < MAXPATHLEN) {
+ if (getcwd(path, MAXPATHLEN) != NULL &&
+ strlen(path) + strlen(file) + 1 < MAXPATHLEN) {
strcat(path, "/");
strcat(path, file);
strcpy(file, path);
@@ -406,7 +406,8 @@ int main(int argc, char *argv[]) {
// switch to plugin dotdir
// this lets plugins work without modification!
gchar *plugin_default_dir = g_build_filename(getenv("HOME"), PLUGINS_DIR, NULL);
- chdir(plugin_default_dir);
+ if(chdir(Config.PluginsDir) < 0)
+ perror(Config.PluginsDir);
g_free(plugin_default_dir);
if (UseGui && runcd != RUN_CD) SetIsoFile(NULL);
@@ -542,7 +543,6 @@ static void SysDisableScreenSaver() {
static time_t fake_key_timer = 0;
static char first_time = 1, has_test_ext = 0, t = 1;
Display *display;
- extern unsigned long gpuDisp;
display = (Display *)gpuDisp;