Changeset: 5c6b2339d169 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5c6b2339d169
Modified Files:
        monetdb5/mal/mal_readline.c
Branch: Jul2012
Log Message:

Removed cd command from mal interpreter.
First of all, it cannot work: the server expects to be in a particular
directory, so changing away from that directory will likely cause a
crash.  Secondly, it would be unsafe to allow this.


diffs (35 lines):

diff --git a/monetdb5/mal/mal_readline.c b/monetdb5/mal/mal_readline.c
--- a/monetdb5/mal/mal_readline.c
+++ b/monetdb5/mal/mal_readline.c
@@ -293,10 +293,6 @@ deinit_readline(void)
 #include <termios.h>
 #endif
 
-#if defined(_MSC_VER) && _MSC_VER >= 1400
-#define chdir _chdir
-#endif
-
 static void
 showCommands(void)
 {
@@ -419,20 +415,6 @@ getConsoleInput(Client c, const char *pr
                                }
                                line = NULL;
                                continue;
-                       case 'c':       /* cd command? */
-                               if (line[1] == 'd' &&
-                                   (line[2] & ~0x7F) == 0 &&
-                                   isspace((int) line[2])) {
-                                       if (line[length - 1] == '\n')
-                                               line[--length] = 0;
-                                       if (line[length - 1] == '\r')
-                                               line[--length] = 0;
-                                       if (chdir(line + 3) < 0)
-                                               perror(line);
-                                       line = NULL;
-                                       continue;
-                               }
-                               break;
 #ifdef HAVE_LIBREADLINE
                        case '!':
                                { char *nl;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to