mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-08 14:54:13 +01:00
changed indentation to use spaces only
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/* wdwrite.c - write key/value to defaults database
|
||||
*
|
||||
* WindowMaker window manager
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1997-2003 Alfredo K. Kojima
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -16,7 +16,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,
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
@@ -49,11 +49,11 @@ gethomedir()
|
||||
struct passwd *user;
|
||||
|
||||
if (home)
|
||||
return home;
|
||||
|
||||
return home;
|
||||
|
||||
user = getpwuid(getuid());
|
||||
if (!user) {
|
||||
perror(ProgName);
|
||||
perror(ProgName);
|
||||
return "/";
|
||||
}
|
||||
if (!user->pw_dir) {
|
||||
@@ -86,38 +86,38 @@ int main(int argc, char **argv)
|
||||
WMPropList *dom, *key, *value, *dict;
|
||||
char *gsdir;
|
||||
int i;
|
||||
|
||||
|
||||
ProgName = argv[0];
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp("--help", argv[i])==0) {
|
||||
help();
|
||||
exit(0);
|
||||
} else if (strcmp("--version", argv[i])==0) {
|
||||
puts(PROG_VERSION);
|
||||
exit(0);
|
||||
}
|
||||
if (strcmp("--help", argv[i])==0) {
|
||||
help();
|
||||
exit(0);
|
||||
} else if (strcmp("--version", argv[i])==0) {
|
||||
puts(PROG_VERSION);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (argc<4) {
|
||||
printf("%s: invalid argument format\n", ProgName);
|
||||
printf("Try '%s --help' for more information\n", ProgName);
|
||||
exit(1);
|
||||
printf("%s: invalid argument format\n", ProgName);
|
||||
printf("Try '%s --help' for more information\n", ProgName);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
dom = WMCreatePLString(argv[1]);
|
||||
key = WMCreatePLString(argv[2]);
|
||||
value = WMCreatePropListFromDescription(argv[3]);
|
||||
if (!value) {
|
||||
printf("%s:syntax error in value \"%s\"", ProgName, argv[3]);
|
||||
exit(1);
|
||||
printf("%s:syntax error in value \"%s\"", ProgName, argv[3]);
|
||||
exit(1);
|
||||
}
|
||||
gsdir = getenv("GNUSTEP_USER_ROOT");
|
||||
if (gsdir) {
|
||||
path = wstrdup(gsdir);
|
||||
path = wstrdup(gsdir);
|
||||
} else {
|
||||
path = wstrdup(gethomedir());
|
||||
path = wstrappend(path, "/GNUstep");
|
||||
path = wstrdup(gethomedir());
|
||||
path = wstrappend(path, "/GNUstep");
|
||||
}
|
||||
path = wstrappend(path, "/");
|
||||
path = wstrappend(path, DEFAULTS_DIR);
|
||||
@@ -126,9 +126,9 @@ int main(int argc, char **argv)
|
||||
|
||||
dict = WMReadPropListFromFile(path);
|
||||
if (!dict) {
|
||||
dict = WMCreatePLDictionary(key, value, NULL);
|
||||
dict = WMCreatePLDictionary(key, value, NULL);
|
||||
} else {
|
||||
WMPutInPLDictionary(dict, key, value);
|
||||
WMPutInPLDictionary(dict, key, value);
|
||||
}
|
||||
|
||||
WMWritePropListToFile(dict, path, True);
|
||||
|
||||
Reference in New Issue
Block a user