omap3-sgx-modules: strip unneeded stuff
[openembedded.git] / recipes / gputty / gputty / conf.patch
1 # Added support to store the configuration in the user home directory
2 # Released under the original terms of the package
3 # Submitted ustream 12/03/04
4
5 --- gputty-0.9.7/src/gputty.c   2004-06-28 06:23:36.000000000 -0700
6 +++ gputty-0.9.7.new/src/gputty.c       2004-07-12 13:32:41.632259216 -0700
7 @@ -424,8 +424,18 @@
8                         (void*)gtk_entry_get_text(GTK_ENTRY(g->hn_eusername)));
9         if(g->config == NULL)
10                 fprintf(stderr, "%s", "gputty: not saving configuration\n");
11 -       else if(config_save(g->config, ".gputty") != 0)
12 +       else {
13 +               char filename[64];
14 +
15 +               if (getenv("HOME")) 
16 +                       snprintf(filename, sizeof(filename) - 1, 
17 +                               "%s/.gputty\n", getenv("HOME"));
18 +               else 
19 +                       strncpy(filename, ".gputty", sizeof(filename) - 1);
20 +
21 +               if(config_save(g->config, filename) != 0)
22                 fprintf(stderr, "%s", "gputty: an error occured while saving configuration\n");
23 +       }
24         gtk_main_quit();
25  }
26