diff lib/misc.c @ 320:853981bbd4d7

2003-11-30 Brian Masney <masneyb@gftp.org> * src/gtk/transfer.c - shows status information in title bar. (patch from Jamil Geor <jamil_geor@yahoo.co.nz>, cleaned up by me some) * lib/options.h - added show_trans_in_title option. 2003-11-25 Brian Masney <masneyb@gftp.org> * lib/misc.c (gftp_locale_init) - call bindtextdomain() so that the directory is setup properly * lib/misc.c lib/gftp.h lib/config_file.c - move copyfile() to config_file.c and declare it to be static. On the destination file, set the flag O_EXCL
author masneyb
date Sun, 30 Nov 2003 19:35:24 +0000
parents cc2eeb30b793
children 0fcc6468a0af
line wrap: on
line diff
--- a/lib/misc.c	Sun Nov 23 15:52:22 2003 +0000
+++ b/lib/misc.c	Sun Nov 30 19:35:24 2003 +0000
@@ -260,60 +260,6 @@
 }
 
 
-int
-copyfile (char *source, char *dest)
-{
-  int srcfd, destfd;
-  char buf[8192];
-  ssize_t n;
-
-  if ((srcfd = gftp_fd_open (NULL, source, O_RDONLY, 0)) == -1)
-    {
-      printf (_("Error: Cannot open local file %s: %s\n"),
-              source, g_strerror (errno));
-      exit (1);
-    }
-
-  if ((destfd = gftp_fd_open (NULL, dest, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR)) == -1)
-    {
-      printf (_("Error: Cannot open local file %s: %s\n"),
-              dest, g_strerror (errno));
-      close (srcfd);
-      exit (1);
-    }
-
-  while ((n = read (srcfd, buf, sizeof (buf))) > 0)
-    {
-      if (write (destfd, buf, n) == -1)
-        {
-          printf (_("Error: Could not write to socket: %s\n"), 
-                  g_strerror (errno));
-          exit (1);
-        }
-    }
-
-  if (n == -1)
-    {
-      printf (_("Error: Could not read from socket: %s\n"), g_strerror (errno));
-      exit (1);
-    }
-
-  if (close (srcfd) == -1)
-    {
-      printf (_("Error closing file descriptor: %s\n"), g_strerror (errno));
-      exit (1);
-    }
-
-  if (close (destfd) == -1)
-    {
-      printf (_("Error closing file descriptor: %s\n"), g_strerror (errno));
-      exit (1);
-    }
-
-  return (1);
-}
-
-
 /* FIXME - is there a replacement for this */
 int
 gftp_match_filespec (char *filename, char *filespec)
@@ -1281,13 +1227,12 @@
 
   setlocale (LC_ALL, "");
   textdomain ("gftp");
+  bindtextdomain ("gftp", LOCALE_DIR);
 
 #if GLIB_MAJOR_VERSION > 1
   bind_textdomain_codeset ("gftp", "UTF-8");
 #endif
 
-  textdomain ("gftp");
-
-#endif
+#endif /* HAVE_GETTEXT */
 }