aboutsummaryrefslogtreecommitdiffstats
path: root/main/aumix/aumix-2.8-save_load.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/aumix/aumix-2.8-save_load.patch')
-rw-r--r--main/aumix/aumix-2.8-save_load.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/main/aumix/aumix-2.8-save_load.patch b/main/aumix/aumix-2.8-save_load.patch
new file mode 100644
index 0000000000..498716b517
--- /dev/null
+++ b/main/aumix/aumix-2.8-save_load.patch
@@ -0,0 +1,45 @@
+--- a/src/common.c 2002-11-28 14:22:00.000000000 +0100
++++ b/src/common.c 2002-11-28 14:23:11.000000000 +0100
+@@ -116,6 +116,7 @@
+ int main(int argc, char *argv[])
+ {
+ int optn, ii;
++ int save = 0, load = 0;
+ #ifdef HAVE_CURSES
+ int setcolors = FALSE;
+ #endif /* HAVE_CURSES */
+@@ -171,14 +172,10 @@
+ break;
+ #endif /* HAVE_CURSES */
+ case 'S': /* Save to file. */
+- if (mixer_fd == -1)
+- ErrorExitWarn(InitializeMixer(device_filename), 'e');
+- ErrorExitWarn(SaveSettings(), 'e');
++ save = 1;
+ break;
+ case 'L': /* Load from file. */
+- if (mixer_fd == -1)
+- ErrorExitWarn(InitializeMixer(device_filename), 'e');
+- ErrorExitWarn(LoadSettings(), 'e');
++ load = 1;
+ break;
+ #if defined (HAVE_CURSES) || defined (HAVE_GTK) || defined (HAVE_GTK1)
+ case 'I': /* User asked for interactive mode. */
+@@ -194,6 +191,17 @@
+ }
+ }
+ }
++ if (save | load) {
++ if (mixer_fd == -1)
++ ErrorExitWarn(InitializeMixer(device_filename), 'e');
++ if (save)
++ ErrorExitWarn(SaveSettings(), 'e');
++ else
++ ErrorExitWarn(LoadSettings(), 'e');
++ close(mixer_fd);
++ exit(EXIT_SUCCESS);
++ }
++
+ #if defined (HAVE_CURSES) || defined (HAVE_GTK) || defined (HAVE_GTK1)
+ /* Be interactive if no options were given. */
+ if (!interactive && argc <= 1)