[Pkg-wmaker-commits] [wmifs] 67/118: wmgeneral: Merge 2003-10-10 version from wmmon and wmtime.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Thu Aug 27 02:37:53 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmifs.
commit 43ea0c20e3ed72d5f3eb4b914ae8d2778843c7de
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date: Tue May 19 22:30:49 2015 -0500
wmgeneral: Merge 2003-10-10 version from wmmon and wmtime.
Note that this was a fork of the earlier 1998-05-02 version and didn't
contain the later changes. Therefore we merge the best of both versions.
wmtime had some additional unnecessary dummy variables, so we use the wmmon
version.
---
wmgeneral/wmgeneral.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/wmgeneral/wmgeneral.c b/wmgeneral/wmgeneral.c
index c064b39..739003d 100644
--- a/wmgeneral/wmgeneral.c
+++ b/wmgeneral/wmgeneral.c
@@ -11,7 +11,9 @@
---
CHANGES:
- ---
+ ---
+ 10/10/2003 (Simon Law, sfllaw at debian.org)
+ * changed the parse_rcfile function to use getline instead of fgets.
14/09/1998 (Dave Clark, clarkd at skyia.com)
* Updated createXBMfromXPM routine
* Now supports >256 colors
@@ -134,7 +136,8 @@ void parse_rcfile(const char *filename, rckeys *keys) {
void parse_rcfile2(const char *filename, rckeys2 *keys) {
char *p;
- char temp[128];
+ char *line = NULL;
+ size_t line_size = 0;
char *tokens = " :\t\n";
FILE *fp;
int i,key;
@@ -142,10 +145,10 @@ void parse_rcfile2(const char *filename, rckeys2 *keys) {
fp = fopen(filename, "r");
if (fp) {
- while (fgets(temp, 128, fp)) {
+ while (getline(&line, &line_size, fp) >= 0) {
key = 0;
while (key >= 0 && keys[key].label) {
- if ((p = strstr(temp, keys[key].label))) {
+ if ((p = strstr(line, keys[key].label))) {
p += strlen(keys[key].label);
p += strspn(p, tokens);
if ((i = strcspn(p, "#\n"))) p[i] = 0;
@@ -383,14 +386,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
int i, wx, wy;
for (i=1; argv[i]; i++) {
- if (!strcmp(argv[i], "-display")) {
- display_name = argv[i+1];
- i++;
- }
- if (!strcmp(argv[i], "-geometry")) {
- geometry = argv[i+1];
- i++;
- }
+ if (!strcmp(argv[i], "-display"))
+ display_name = argv[++i];
+ else if (!strcmp(argv[i], "-geometry"))
+ geometry = argv[++i];
}
if (!(display = XOpenDisplay(display_name))) {
@@ -416,6 +415,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints,
&mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy);
+ if (geometry)
+ XParseGeometry(geometry, &mysizehints.x, &mysizehints.y,
+ (unsigned int *) &mysizehints.width, (unsigned int *) &mysizehints.height);
mysizehints.width = 64;
mysizehints.height = 64;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmifs.git
More information about the Pkg-wmaker-commits
mailing list