$NetBSD: patch-ad,v 1.1 2002/10/05 01:20:46 wiz Exp $

--- action.c.orig	Sat Feb  2 15:31:32 2002
+++ action.c
@@ -132,7 +132,7 @@ static guchar	*last_find_string = NULL;
 static guchar	*new_entry_string = NULL;
 
 /* Static prototypes */
-static gboolean send();
+static gboolean gsend();
 static gboolean send_error();
 static gboolean send_dir(char *dir);
 static gboolean read_exact(int source, char *buffer, ssize_t len);
@@ -566,7 +566,7 @@ static void for_dir_contents(ForDirCB *c
 		g_string_sprintf(message, "!%s '%s': %s\n",
 				_("ERROR reading"),
 				src_dir, g_strerror(errno));
-		send();
+		gsend();
 		return;
 	}
 
@@ -613,7 +613,7 @@ static gboolean read_exact(int source, c
 }
 
 /* Send 'message' to our parent process. TRUE on success. */
-static gboolean send(void)
+static gboolean gsend(void)
 {
 	char len_buffer[5];
 	ssize_t len;
@@ -631,13 +631,13 @@ static gboolean send(void)
 static gboolean send_dir(char *dir)
 {
 	g_string_sprintf(message, "/%s", dir);
-	return send();
+	return gsend();
 }
 
 static gboolean send_error(void)
 {
 	g_string_sprintf(message, "!%s: %s\n", _("ERROR"), g_strerror(errno));
-	return send();
+	return gsend();
 }
 
 static void quiet_clicked(GtkWidget *button, GUIside *gui_side)
@@ -741,7 +741,7 @@ static void process_flag(char flag)
 		default:
 			g_string_sprintf(message,
 					"!ERROR: Bad message '%c'\n", flag);
-			send();
+			gsend();
 			break;
 	}
 }
@@ -778,7 +778,7 @@ static void check_flags(void)
 
 /* Read until the user sends a reply. If ignore_quiet is TRUE then
  * the user MUST click Yes or No, else treat quiet on as Yes.
- * If the user needs prompting then does send().
+ * If the user needs prompting then does gsend().
  */
 static gboolean reply(int fd, gboolean ignore_quiet)
 {
@@ -788,7 +788,7 @@ static gboolean reply(int fd, gboolean i
 	if (quiet && !ignore_quiet)
 		return TRUE;
 
-	send();
+	gsend();
 
 	while (1)
 	{
@@ -804,11 +804,11 @@ static gboolean reply(int fd, gboolean i
 		{
 			case 'Y':
 				g_string_sprintf(message, "' %s\n", _("Yes"));
-				send();
+				gsend();
 				return TRUE;
 			case 'N':
 				g_string_sprintf(message, "' %s\n", _("No"));
-				send();
+				gsend();
 				return FALSE;
 			default:
 				process_flag(retval);
@@ -1043,7 +1043,7 @@ static void do_usage(char *src_path, cha
 	if (mc_lstat(src_path, &info))
 	{
 		g_string_sprintf(message, "'%s:\n", src_path);
-		send();
+		gsend();
 		send_error();
 	}
 	else if (S_ISREG(info.st_mode) || S_ISLNK(info.st_mode))
@@ -1096,7 +1096,7 @@ static void do_delete(char *src_path, ch
 	else if (!o_brief)
 	{
 		g_string_sprintf(message, _("'Deleting '%s'\n"), src_path);
-		send();
+		gsend();
 	}
 
 	safe_path = g_strdup(src_path);
@@ -1112,16 +1112,16 @@ static void do_delete(char *src_path, ch
 		}
 		g_string_sprintf(message, _("'Directory '%s' deleted\n"),
 				safe_path);
-		send();
+		gsend();
 		g_string_sprintf(message, "m%s", safe_path);
-		send();
+		gsend();
 	}
 	else if (unlink(src_path))
 		send_error();
 	else
 	{
 		g_string_sprintf(message, "s%s", safe_path);
-		send();
+		gsend();
 	}
 
 	g_free(safe_path);
@@ -1160,7 +1160,7 @@ static void do_find(char *path, char *un
 
 		g_string_assign(message, _("!Invalid find condition - "
 						"change it and try again\n"));
-		send();
+		gsend();
 		g_string_sprintf(message, _("?Check '%s'?"), path);
 		if (!reply(from_parent, TRUE))
 			return;
@@ -1170,7 +1170,7 @@ static void do_find(char *path, char *un
 	{
 		send_error();
 		g_string_sprintf(message, _("'(while checking '%s')\n"), path);
-		send();
+		gsend();
 		return;
 	}
 
@@ -1183,7 +1183,7 @@ static void do_find(char *path, char *un
 	if (find_test_condition(find_condition, &info))
 	{
 		g_string_sprintf(message, "=%s", path);
-		send();
+		gsend();
 	}
 
 	if (S_ISDIR(info.stats.st_mode) && !info.prune)
@@ -1254,7 +1254,7 @@ static void do_chmod(char *path, char *u
 		g_string_sprintf(message,
 				_("'Changing permissions of '%s'\n"),
 				path);
-		send();
+		gsend();
 	}
 
 	for (;;)
@@ -1274,7 +1274,7 @@ static void do_chmod(char *path, char *u
 
 		g_string_assign(message,
 			_("!Invalid mode command - change it and try again\n"));
-		send();
+		gsend();
 		g_string_sprintf(message,
 				_("?Change permissions of '%s'?"), path);
 		if (!reply(from_parent, TRUE))
@@ -1297,12 +1297,12 @@ static void do_chmod(char *path, char *u
 	}
 
 	g_string_sprintf(message, "s%s", path);
-	send();
+	gsend();
 
 	if (S_ISDIR(info.st_mode))
 	{
 		g_string_sprintf(message, "m%s", path);
-		send();
+		gsend();
 
 		if (o_recurse)
 		{
@@ -1381,7 +1381,7 @@ static void do_copy2(char *path, char *d
 					return;
 				g_string_sprintf(message,
 						_("'Trying copy anyway...\n"));
-				send();
+				gsend();
 			}
 		}
 	}
@@ -1396,7 +1396,7 @@ static void do_copy2(char *path, char *d
 	{
 		g_string_sprintf(message, _("'Copying %s as %s\n"), path,
 				dest_path);
-		send();
+		gsend();
 	}
 
 	if (S_ISDIR(info.st_mode))
@@ -1416,7 +1416,7 @@ static void do_copy2(char *path, char *d
 			g_string_sprintf(message,
 				_("!ERROR: Destination already exists, "
 					"but is not a directory\n"));
-			send();
+			gsend();
 		}
 		else if (exists == FALSE && mkdir(dest_path, 0700 | mode))
 			send_error();
@@ -1426,7 +1426,7 @@ static void do_copy2(char *path, char *d
 			{
 				/* (just been created then) */
 				g_string_sprintf(message, "s%s", dest_path);
-				send();
+				gsend();
 			}
 
 			action_leaf = NULL;
@@ -1471,7 +1471,7 @@ static void do_copy2(char *path, char *d
 			else
 			{
 				g_string_sprintf(message, "s%s", dest_path);
-				send();
+				gsend();
 			}
 
 			g_free(target);
@@ -1490,12 +1490,12 @@ static void do_copy2(char *path, char *d
 			g_string_sprintf(message, _("!%s\nFailed to copy '%s'"),
 					error, path);
 			g_free(error);
-			send();
+			gsend();
 		}
 		else
 		{
 			g_string_sprintf(message, "s%s", dest_path);
-			send();
+			gsend();
 		}
 	}
 }
@@ -1544,7 +1544,7 @@ static void do_move2(char *path, char *d
 				return;
 			g_string_sprintf(message,
 					_("'Trying move anyway...\n"));
-			send();
+			gsend();
 		}
 	}
 	else if (!quiet)
@@ -1558,7 +1558,7 @@ static void do_move2(char *path, char *d
 	{
 		g_string_sprintf(message, _("'Moving %s as %s\n"), path,
 				dest_path);
-		send();
+		gsend();
 	}
 
 	argv[2] = path;
@@ -1570,21 +1570,21 @@ static void do_move2(char *path, char *d
 		g_string_sprintf(message,
 				_("!%s\nFailed to move %s as %s\n"),
 				err, path, dest_path);
-		send();
+		gsend();
 
 		g_free(err);
 	}
 	else
 	{
 		g_string_sprintf(message, "s%s", dest_path);
-		send();
+		gsend();
 
 		if (is_dir)
 			g_string_sprintf(message, "m%s", path);
 		else
 			g_string_sprintf(message, "s%s", path);
 
-		send();
+		gsend();
 	}
 }
 
@@ -1597,7 +1597,7 @@ static void do_copy(char *path, char *de
 	{
 		g_string_sprintf(message,
 			_("!ERROR: Can't copy object into itself\n"));
-		send();
+		gsend();
 	}
 	else
 		do_copy2(path, dest);
@@ -1612,7 +1612,7 @@ static void do_move(char *path, char *de
 	{
 		g_string_sprintf(message,
 			_("!ERROR: Can't move/rename object into itself\n"));
-		send();
+		gsend();
 	}
 	else
 		do_move2(path, dest);
@@ -1630,7 +1630,7 @@ static void do_link(char *path, char *de
 	{
 		g_string_sprintf(message, _("'Linking %s as %s\n"), path,
 				dest_path);
-		send();
+		gsend();
 	}
 	else
 	{
@@ -1645,7 +1645,7 @@ static void do_link(char *path, char *de
 	else
 	{
 		g_string_sprintf(message, "s%s", dest_path);
-		send();
+		gsend();
 	}
 }
 
@@ -1666,7 +1666,7 @@ static void do_mount(guchar *path, gbool
 				mount ? _("'Mounting %s\n")
 				      : _("'Unmounting %s\n"),
 				path);
-		send();
+		gsend();
 	}
 	else
 	{
@@ -1684,17 +1684,17 @@ static void do_mount(guchar *path, gbool
 		g_string_sprintf(message, mount ?
 			_("!%s\nMount failed\n") :
 			_("!%s\nUnmount failed\n"), err);
-		send();
+		gsend();
 		g_free(err);
 	}
 	else
 	{
 		g_string_sprintf(message, "M%s", path);
-		send();
+		gsend();
 		if (mount && mount_open_dir)
 		{
 			g_string_sprintf(message, "o%s", path);
-			send();
+			gsend();
 		}
 	}
 }
@@ -1725,7 +1725,7 @@ static void usage_cb(gpointer data)
 		g_string_sprintf(message, "'%s: %s\n",
 				g_basename(path),
 				format_double_size(size_tally));
-		send();
+		gsend();
 		total_size += size_tally;
 	}
 
@@ -1754,7 +1754,7 @@ static void usage_cb(gpointer data)
 		g_free(tmp);
 	}
 	
-	send();
+	gsend();
 }
 
 #ifdef DO_MOUNT_POINTS
@@ -1780,7 +1780,7 @@ static void mount_cb(gpointer data)
 	g_string_sprintf(message,
 			 mount_points ? _("'\nDone\n")
 			 	      : _("!No mount points selected!\n"));
-	send();
+	gsend();
 }
 #endif
 
@@ -1816,7 +1816,7 @@ static void delete_cb(gpointer data)
 	}
 	
 	g_string_sprintf(message, _("'\nDone\n"));
-	send();
+	gsend();
 }
 
 static void find_cb(gpointer data)
@@ -1839,11 +1839,11 @@ static void find_cb(gpointer data)
 		if (!reply(from_parent, TRUE))
 			break;
 		g_string_assign(message, "#");
-		send();
+		gsend();
 	}
 	
 	g_string_sprintf(message, _("'\nDone\n"));
-	send();
+	gsend();
 }
 
 static void chmod_cb(gpointer data)
@@ -1864,14 +1864,14 @@ static void chmod_cb(gpointer data)
 			g_string_sprintf(message,
 					_("!'%s' is a symbolic link\n"),
 					g_basename(path));
-			send();
+			gsend();
 		}
 		else
 			do_chmod(path, NULL);
 	}
 	
 	g_string_sprintf(message, _("'\nDone\n"));
-	send();
+	gsend();
 }
 
 static void list_cb(gpointer data)
@@ -1888,7 +1888,7 @@ static void list_cb(gpointer data)
 	}
 
 	g_string_sprintf(message, _("'\nDone\n"));
-	send();
+	gsend();
 }
 
 static GtkWidget *add_toggle(GUIside *gui_side,
