diff --git a/ChangeLog b/ChangeLog
index e900cb637..d0fde0fb3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -157,6 +157,8 @@
  - (dtucker) [Makefile.in added roaming_client.c roaming_serv.c] Import new
    files for roaming and add to Makefile.
  - (dtucker) [Makefile.in] .c files do not belong in the OBJ lines.
+ - (dtucker) [sftp.c] ifdef out the sftp completion bits for platforms that
+   don't have libedit.
 
 20091226
  - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1
diff --git a/sftp.c b/sftp.c
index 6a5ccc49d..c994887e3 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1503,7 +1503,6 @@ prompt(EditLine *el)
 {
 	return ("sftp> ");
 }
-#endif
 
 /* Display entries in 'list' after skipping the first 'len' chars */
 static void
@@ -1646,6 +1645,7 @@ complete_cmd_parse(EditLine *el, char *cmd, int lastarg, char quote,
 
 	return count;
 }
+#endif
 
 /*
  * Determine whether a particular sftp command's arguments (if any)
@@ -1666,6 +1666,7 @@ complete_is_remote(char *cmd) {
 	return -1;
 }
 
+#ifdef USE_LIBEDIT
 /* Autocomplete a filename "file" */
 static int
 complete_match(EditLine *el, struct sftp_conn *conn, char *remote_path,
@@ -1838,6 +1839,7 @@ complete(EditLine *el, int ch)
 	xfree(line);	
 	return ret;
 }
+#endif /* USE_LIBEDIT */
 
 int
 interactive_loop(struct sftp_conn *conn, char *file1, char *file2)