Only in patched-src: Gnut_Hash.o
Only in patched-src: Gnut_List.o
Only in patched-src: Gnut_Queue.o
Only in patched-src: Makefile
Only in patched-src: blacklist.o
Only in patched-src: cache.o
Only in patched-src: cgi_parse.o
diff -ur src/cli_input.c patched-src/cli_input.c
--- src/cli_input.c	Wed Nov  1 07:19:42 2000
+++ patched-src/cli_input.c	Wed Nov  1 07:16:38 2000
@@ -65,14 +65,14 @@
 int com_blacklist(char *), com_clear(char *), com_cls(char *),
   com_debug(char *), com_eval(char *), com_find(char *), com_get(char *),
   com_help(char *), com_hosts(char *), com_info(char *),
-  com_kill(char *), com_lclear(char *), com_list(char *), 
-  com_limit(char *), com_load(char *), com_log(char *),
-  com_monitor(char *), com_mpush(char *), com_mreply(char *),
-  com_open(char  *), com_play(char *), com_player(char *),
-  com_push(char *), com_quit(char *), com_response(char *), com_save(char *),
+  com_kill(char *), com_list(char *), com_limit(char *),
+  com_load(char *), com_log(char *), com_monitor(char *),
+  com_mpush(char *), com_mreply(char *), com_open(char  *),
+  com_play(char *), com_player(char *), com_push(char *),
+  com_quit(char *), com_response(char *), com_save(char *),
   com_scan(char *), com_set(char *), com_share(char *),
   com_shell(char *), com_sleep(char *), com_stop(char *),
-  com_update(char *), com_version(char *);
+  com_remove(char *), com_update(char *), com_version(char *);
 
 int recu_level;
 int recu_disable;
@@ -208,18 +208,6 @@
     limit 2000 2,10-12      - Limit transfers 2,10,11,12 to 2000 bytes
                               per second.
 "},
-  {"lclear",    com_lclear, "Clear search list.", "
-lclear ID/\"string\" - Clear an active search if multi-searching is
-enabled (eg the \"multi_enable\" configuration flag is set).  lclear
-with no arguments clears all active searches and responses.  
-
-Examples:
-    lclear 3             # removes the search ID 3.
-    lclear 1-3,5         # removes the searches with IDs 1, 2, 3, and 5.
-    lclear \"britney\"   # removes the search for \"britney\"
-    lclear \'spears\'    # removes the search for \"spears\"
-    lclear               # removes all searches and results
-"},
   {"list",      com_list,   "List all current searches.", "
 list - List the active searches if multi-searching is enabled (eg 
 the \"multi_enable\" configuration flag is set).
@@ -348,6 +336,21 @@
     stop 3-6                - Stop 3,4,5,6
     stop 2,10-12            - Stop 2,10,11,12
 "},
+  {"remove",    com_remove, "Remove search from search list.", "
+remove ID/\"string\" - Remove an active search if multi-searching is
+enabled (eg the \"multi_enable\" configuration flag is set).  remove
+with no arguments clears all active searches and responses.  
+
+Examples:
+    remove 3             # removes the search ID 3.
+    remove 1-3,5         # removes the searches with IDs 1, 2, 3, and 5.
+    remove \"britney\"   # removes the search for \"britney\"
+    remove \'spears\'    # removes the search for \"spears\"
+    remove               # removes all searches and results
+"},
+  {"rm",    com_remove,   "Synonym for 'remove'.", "
+remove - synonym for 'remove' (type 'help remove').
+"},
   {"update",    com_update, "Update the current host list.", "
 update - Send out ping packets to all connected hosts. If
 configuration variable 'update_clear' is set, then the current host
@@ -436,8 +439,6 @@
   
   len=strlen(a);
 
-  /* WE REALLY REALLY SHOULD BE USING snprintf() here, but i'm not
-	 sure if it's available on windows machines */
 #ifndef WIN32
   strncpy(buf1, a, sizeof(buf1));
   do {
@@ -1244,7 +1245,8 @@
 	  send_to_all(gpa); /* %%%RPM on new connection, do a send_to_one if a query is currently pending */
 	  
 	  if (!conf_get_int("wait_after_find")) {
-		printf(UI_FIND_WHEN_YOU);
+		if (!conf_get_int("multi_enable"))
+		 	printf(UI_FIND_WHEN_YOU);
 		return 0;
 	  }
 	  printf("Searching the gnutella network for: %s \n", arg);
@@ -1289,7 +1291,7 @@
 	return 0;
 }
 
-int com_lclear(char *arg)
+int com_remove(char *arg)
 {
 	GnutSearch *search;
 	char       buf[1024] = "";
@@ -1335,7 +1337,7 @@
 {
 	int user_id = 1;
 	if (conf_get_int("multi_enable"))	{
-		printf("ID,  Num, String\n");
+		printf("Current Searches:\n ID,  Num, String\n");
 		gnut_search_foreach(list_search_cb, &user_id);
 	} else {
 		printf("Multisearch is disabled.\n");
Only in patched-src: cli_input.o
Only in patched-src: cli_interface.o
Only in patched-src: cli_output.o
Only in patched-src: cli_readline.o
Only in patched-src: conf.o
Only in patched-src: gnut
Only in patched-src: gnut.o
Only in patched-src: gnut_connection.o
Only in patched-src: gnut_http.o
Only in patched-src: gnut_if.o
Only in patched-src: gnut_lib.o
Only in patched-src: gnut_net.o
Only in patched-src: gnut_threads.o
Only in patched-src: gnut_transfer.o
Only in patched-src: host.o
Only in patched-src: http_core.o
Only in patched-src: http_header.o
Only in patched-src: monitor.o
Only in patched-src: player.o
diff -ur src/prompt.c patched-src/prompt.c
--- src/prompt.c	Wed Aug  9 21:07:36 2000
+++ patched-src/prompt.c	Wed Nov  1 07:13:16 2000
@@ -55,6 +55,8 @@
   {"MSGS_S",		prompt_net_stats},
   {"BYTES_R",		prompt_net_stats},
   {"BYTES_S",		prompt_net_stats},
+  {"MULTI_COUNT",     prompt_multi_count_stats},
+  {"MULTI_RESPONSES", prompt_multi_results_stats},
   {"QUERIES",		prompt_query_stats},
   {"QUERY_RESP",		prompt_query_stats},
   {"NUM_SHARED",		prompt_share_stats},
@@ -71,10 +73,15 @@
 {
   static char prompt[PROMPT_STR_LEN];
   char *chr, *position;
-  
+  char temp[PROMPT_STR_LEN];
+  char bt_err = 0, found_bt = 0, *bqs, *bqe = 0,
+       buf1[1024] = "", buf2[1024] = "", buf3[1024] = "";  
+  FILE *p = NULL;
+
   bzero((void *)prompt, PROMPT_STR_LEN);
   chr = conf_get_str("prompt");
   
+  /* variable interpolation */
   do {
 	position = strstr(chr, "${");
 	
@@ -86,6 +93,77 @@
 	  strcat(prompt, chr);			/* TODO: make this not a buffer overflow */
 	}
   } while(position);
+
+  /* newline/backtick interpolation */
+  for (chr=prompt; *chr&&*(chr+1); chr++)
+	if (*chr=='\\'&&*(chr+1)=='\\') {
+		*chr=0;
+		sprintf(temp, "%s%s", prompt, chr+1);
+	/*	strcpy(temp,prompt);
+		strcat(temp, chr+1);*/
+		strcpy(prompt, temp);
+		chr = prompt;
+	} else if (*chr=='\\'&&*(chr+1)=='`') {
+		*chr=0;
+		sprintf(temp, "%s%s", prompt, chr+1);
+	/*	strcpy(temp,prompt);
+		strcat(temp, chr+1);*/
+		strcpy(prompt, temp);
+		chr = prompt;
+	} else if (*chr=='\\'&&*(chr+1)=='n') {
+		*chr=' ';
+		*(chr+1) = '\n';
+	}
+
+  /* backtick interpolation */
+#ifndef WIN32
+  strncpy(buf1, prompt, sizeof(buf1));
+  bt_err = 0;
+  do {
+	found_bt = 0;
+	for (bqs=buf1; *bqs&&!bt_err; bqs++) {
+	  if (*bqs=='`' && (bqs-buf1==0 || *(bqs-1) != '\\')) {
+		for (bqe=bqs+1; *bqe&&!bt_err; bqe++) {
+		  if (*bqe=='`' && *(bqe-1) != '\\') {
+			found_bt = 1;
+			break;
+		  }
+		}
+		if (!found_bt) {
+		  bt_err++;
+		  break;
+		} 
+		
+		/* fprintf(stderr, "DEBUG: execing \"%s\".\n", bqs+1); */
+		*bqs = 0; *bqe = 0;
+		p = popen(bqs+1, "r");
+		if (!p) {
+		  bt_err++;
+		  break;
+		}
+		/* get the last line output by the cmd. this is arguably the
+		 * wrong behavior -- we might want to be using only
+		 * the first line, or all of them.. etc etc */
+		while (fgets(buf3, sizeof(buf3), p)) { }
+
+		if (strlen(buf3) && buf3[strlen(buf3)-1]=='\n')
+		  buf3[strlen(buf3)-1]=0;
+		pclose(p);
+		
+		/* fprintf(stderr,"DEBUG: replacing \"%s\" with \"%s\".\n", bqs+1, buf3); */
+		
+		snprintf(buf2, sizeof(buf2), "%s%s%s", buf1, buf3, bqe+1);
+		/* fprintf(stderr,"DEBUG: final string = \"%s\"\n", buf2); */
+		/*printf("%s\n", buf2);*/
+		strncpy(buf1, buf2, sizeof(buf1));
+		break;
+	  }
+	}
+  } while (found_bt&&!bt_err);
+
+  if (!bt_err)
+  	strcpy(prompt,buf1);
+#endif
   
   return prompt;
 }
@@ -286,4 +364,35 @@
 #else
 	strcpy(result, "0");
 #endif
+}
+
+void prompt_multi_results_stats_cb(GnutSearch *search, void *data)
+{
+	char buf[BUF_MAX],
+	     tmp[BUF_MAX] = "";
+	if (search->user_id!=-1)
+		sprintf(tmp, "%d:", search->user_id);
+	else
+		sprintf(tmp, "?:");
+	sprintf(buf, "%s%s%d%s", result, tmp,
+	        search->responses, search->next?", ":"");
+	strcpy(result, buf);
+}
+
+void prompt_multi_results_stats(char *var_name)
+{
+	strcpy(result, "");
+	if (conf_get_int("multi_enable"))
+		gnut_search_foreach(prompt_multi_results_stats_cb,NULL);
+	else
+		strcpy(result,"0");
+
+	return;
+}
+void prompt_multi_count_stats(char *var_name)
+{
+	if (conf_get_int("multi_enable"))
+		sprintf(result, "%d", gnut_search_count());
+	else
+		strcpy(result, "0");
 }
diff -ur src/prompt.h patched-src/prompt.h
--- src/prompt.h	Wed Aug  9 21:08:20 2000
+++ patched-src/prompt.h	Wed Nov  1 07:11:30 2000
@@ -3,7 +3,7 @@
 #ifndef PROMPT_H
 #define PROMPT_H
 
-#define PROMPT_STR_LEN	256
+#define PROMPT_STR_LEN	1024
 #define BUF_MAX		32
 
 typedef struct _Variable_Info Variable_Info;
@@ -27,6 +27,8 @@
 void prompt_query_stats(char *);
 void prompt_share_stats(char *);
 void prompt_results_stats(char *);
+void prompt_multi_results_stats(char *);
+void prompt_multi_count_stats(char *);
 
 #ifdef __cplusplus
 }
Only in patched-src: prompt.o
Only in patched-src: protocol.o
Only in patched-src: query.o
Only in patched-src: route.o
Only in patched-src: share.o
Only in patched-src: share_cache.o
Only in patched-src/win32pth: Makefile

