Windows PSCP now links against winsftp.c, and scp.c is now a
[u/mdw/putty] / unix / uxsftp.c
index e9c9f6e..d1989f8 100644 (file)
@@ -1,12 +1,11 @@
 /*\r
- * uxsftp.c: the Unix-specific parts of PSFTP.\r
+ * uxsftp.c: the Unix-specific parts of PSFTP and PSCP.\r
  */\r
 \r
 #include <sys/time.h>\r
 #include <sys/types.h>\r
 #include <unistd.h>\r
 #include <errno.h>\r
-#include <pwd.h>\r
 \r
 #include "putty.h"\r
 #include "psftp.h"\r
@@ -34,45 +33,6 @@ void platform_get_x11_auth(char *display, int *protocol,
  */\r
 char *platform_default_s(const char *name)\r
 {\r
-    if (!strcmp(name, "UserName")) {\r
-       /*\r
-        * Remote login username will default to the local username.\r
-        */\r
-       struct passwd *p;\r
-       uid_t uid = getuid();\r
-       char *user, *ret = NULL;\r
-\r
-       /*\r
-        * First, find who we think we are using getlogin. If this\r
-        * agrees with our uid, we'll go along with it. This should\r
-        * allow sharing of uids between several login names whilst\r
-        * coping correctly with people who have su'ed.\r
-        */\r
-       user = getlogin();\r
-       setpwent();\r
-       if (user)\r
-           p = getpwnam(user);\r
-       else\r
-           p = NULL;\r
-       if (p && p->pw_uid == uid) {\r
-           /*\r
-            * The result of getlogin() really does correspond to\r
-            * our uid. Fine.\r
-            */\r
-           ret = user;\r
-       } else {\r
-           /*\r
-            * If that didn't work, for whatever reason, we'll do\r
-            * the simpler version: look up our uid in the password\r
-            * file and map it straight to a name.\r
-            */\r
-           p = getpwuid(uid);\r
-           ret = p->pw_name;\r
-       }\r
-       endpwent();\r
-\r
-       return ret;\r
-    }\r
     return NULL;\r
 }\r
 \r
@@ -99,6 +59,18 @@ Filename platform_default_filename(const char *name)
 }\r
 \r
 /*\r
+ * Stubs for the GUI feedback mechanism in Windows PSCP.\r
+ */\r
+void gui_update_stats(char *name, unsigned long size,\r
+                     int percentage, unsigned long elapsed,\r
+                     unsigned long done, unsigned long eta,\r
+                     unsigned long ratebs) {}\r
+void gui_send_errcount(int list, int errs) {}\r
+void gui_send_char(int is_stderr, int c) {}\r
+void gui_enable(char *arg) {}\r
+\r
+\r
+/*\r
  * Set local current directory. Returns NULL on success, or else an\r
  * error message which must be freed after printing.\r
  */\r