-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: dmenu
action: commit
revision:
path_from:
revision_from: 5029728882efff6136a5bd3235dad65104a8f3c7:
path_to:
revision_to:

git.thebackupbox.net

dmenu

git://git.thebackupbox.net/dmenu

commit 5029728882efff6136a5bd3235dad65104a8f3c7
Author: epoch <epoch@enzo.thebackupbox.net>
Date:   Tue May 3 05:43:04 2022 +0000

    made compiler shut up about warnings and lowered the select timeout so the spinner spins faster. :)

diff --git a/config.def.h b/config.def.h

index 1edb647789c7befe9e98a046a78260e4b580a30a..

index ..30a8acc70c1214cd0e6df08b9f60cd2bc6d1b63f 100644

--- a/config.def.h
+++ b/config.def.h
@@ -6,7 +6,7 @@ static int topbar = 1;                      /* -b  option; if 0, dmenu appears a
 static const char *fonts[] = {
 	"monospace:size=10"
 };
-static const char *prompt      = NULL;      /* -p  option; prompt to the left of input field */
+static char *prompt      = NULL;      /* -p  option; prompt to the left of input field */
 static const char *colors[SchemeLast][2] = {
 	/*     fg         bg       */
 	[SchemeNorm] = { "#bbbbbb", "#222222" },
diff --git a/dmenu.c b/dmenu.c

index 7665c46179fc89b81d800e68a1d97002c0f7180f..

index ..7e62ea8b4837770ddc9aa6546b7d090caf3a3e72 100644

--- a/dmenu.c
+++ b/dmenu.c
@@ -23,7 +23,7 @@

 /* macros */
 #define INTERSECT(x,y,w,h,r)  (MAX(0, MIN((x)+(w),(r).x_org+(r).width)  - MAX((x),(r).x_org)) \
-                             * MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org)))
+                            && MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org)))
 #define LENGTH(X)             (sizeof X / sizeof X[0])
 #define TEXTW(X)              (drw_fontset_getwidth(drw, (X)) + lrpad)

@@ -647,7 +647,7 @@ readstdin(void)
 }

 static void update_prompt(char *orig_prompt,int lines_read,int done_reading) {
-	static spin=0;
+	static int spin=0;
 	if(done_reading) {
 		spin=4;
 	} else {
@@ -669,9 +669,8 @@ run(void)
 		die("cannot get stdin control flags:");
 	if (fcntl(0, F_SETFL, flags | O_NONBLOCK) == -1)
 		die("cannot set stdin control flags:");
-	char tmp_prompt;
 	char *orig_prompt=NULL;
-	time_t old_time,curr_time;
+	time_t old_time=0,curr_time;
 	int lines_read=0;
 	int done_reading=0;
 	struct timeval timeout;
@@ -689,16 +688,14 @@ run(void)
 		if(!done_reading) {
 			FD_SET(0, &fds);
 		}
-		timeout.tv_sec=1;
-		timeout.tv_usec=0;
+		timeout.tv_sec=0;
+		timeout.tv_usec=100000;
 		if (select(xfd + 1, &fds, NULL, NULL, &timeout) == -1)
 			die("cannot multiplex input:");
 		if (FD_ISSET(xfd, &fds)) {
-			fprintf(stderr,"%d \x1b[31mread event\x1b[0m\n",time(0));
 			readevent();
 		}
 		if (FD_ISSET(0, &fds)) {
-			fprintf(stderr,"%d \x1b[32mread stdin\x1b[0m\n",time(0));
 			if(!readstdin()) {
 				done_reading=1;
 			}

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 18:29:52 2024