projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added .gitattributes file such that lexer.at shows diff
[pspp]
/
src
/
ui
/
gui
/
main.c
diff --git
a/src/ui/gui/main.c
b/src/ui/gui/main.c
index 9a7f8e1987a7d8a7def941e471df7f37bc500e79..51d225765c12796d21cdaf1aff7f8f02dc5a8eea 100644
(file)
--- a/
src/ui/gui/main.c
+++ b/
src/ui/gui/main.c
@@
-1,6
+1,5
@@
/* PSPPIRE - a graphical user interface for PSPP.
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2004, 2005, 2006, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
- 2020 Free Software Foundation
+ Copyright (C) 2004, 2005, 2006, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-21,23
+20,8
@@
#include <gtk/gtk.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include <stdlib.h>
-#include <sys/stat.h>
#if ENABLE_RELOCATABLE && defined(__APPLE__)
#if ENABLE_RELOCATABLE && defined(__APPLE__)
-#include <sys/resource.h>
-static const bool apple_relocatable = true;
-#else
-static const bool apple_relocatable = false;
-#if HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#else
-/* Dummy definitions to keep the compiler happy. */
-struct rlimit
-{
- int rlim_cur;
- int rlim_max;
-};
-#define RLIMIT_NOFILE 0
-#endif
+#include <sys/stat.h>
#endif
#include "language/lexer/include-path.h"
#endif
#include "language/lexer/include-path.h"
@@
-333,6
+317,7
@@
process_pre_start_arguments (int *argc, char ***argv)
g_option_context_free (oc);
}
g_option_context_free (oc);
}
+#if ENABLE_RELOCATABLE && defined(__APPLE__)
static void
pspp_macos_setenv (const char * progname)
{
static void
pspp_macos_setenv (const char * progname)
{
@@
-389,29
+374,30
@@
pspp_macos_setenv (const char * progname)
}
}
}
}
}
}
+#endif
int
main (int argc, char *argv[])
{
int
main (int argc, char *argv[])
{
- if (apple_relocatable)
+
+#if ENABLE_RELOCATABLE && defined(__APPLE__)
+ /* remove MacOS session identifier from the command line args */
+ gint newargc = 0;
+ for (gint i = 0; i < argc; i++)
{
{
- /* remove MacOS session identifier from the command line args */
- gint newargc = 0;
- for (gint i = 0; i < argc; i++)
- {
- if (!g_str_has_prefix (argv[i], "-psn_"))
- {
- argv[newargc] = argv[i];
- newargc++;
- }
- }
- if (argc > newargc)
+ if (!g_str_has_prefix (argv[i], "-psn_"))
{
{
- argv[newargc] =
NULL; /* glib expects NULL terminated array */
-
argc = newargc
;
+ argv[newargc] =
argv[i];
+
newargc++
;
}
}
- pspp_macos_setenv (argv[0]);
}
}
+ if (argc > newargc)
+ {
+ argv[newargc] = NULL; /* glib expects NULL terminated array */
+ argc = newargc;
+ }
+ pspp_macos_setenv (argv[0]);
+#endif
set_program_name (argv[0]);
set_program_name (argv[0]);