mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-02 14:15:46 +01:00
changed indentation to use spaces only
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
/* wdread.c - read value from defaults database
|
||||
*
|
||||
* WindowMaker window manager
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1997-2003 Alfredo K. Kojima
|
||||
* (cowardly remade from wdwrite.c; by judas@hell on Jan 26 2001)
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -17,7 +17,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.
|
||||
*/
|
||||
|
||||
@@ -50,11 +50,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) {
|
||||
@@ -66,7 +66,8 @@ gethomedir()
|
||||
|
||||
|
||||
|
||||
void wAbort()
|
||||
void
|
||||
wAbort()
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
@@ -87,33 +88,33 @@ int main(int argc, char **argv)
|
||||
WMPropList *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<3) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
key = WMCreatePLString(argv[2]);
|
||||
|
||||
|
||||
gsdir = getenv("GNUSTEP_USER_ROOT");
|
||||
if (gsdir) {
|
||||
strcpy(path, gsdir);
|
||||
strcpy(path, gsdir);
|
||||
} else {
|
||||
strcpy(path, gethomedir());
|
||||
strcat(path, "/GNUstep");
|
||||
strcpy(path, gethomedir());
|
||||
strcat(path, "/GNUstep");
|
||||
}
|
||||
strcat(path, "/");
|
||||
strcat(path, DEFAULTS_DIR);
|
||||
@@ -121,9 +122,9 @@ int main(int argc, char **argv)
|
||||
strcat(path, argv[1]);
|
||||
|
||||
if ((dict = WMReadPropListFromFile(path)) == NULL)
|
||||
return 1; /* bad domain */
|
||||
return 1; /* bad domain */
|
||||
if ((value = WMGetFromPLDictionary(dict, key)) == NULL)
|
||||
return 2; /* bad key */
|
||||
return 2; /* bad key */
|
||||
|
||||
printf("%s\n", WMGetPropListDescription(value, True));
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user