aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--mpiosh/callback.c72
-rw-r--r--mpiosh/readline.c7
3 files changed, 52 insertions, 37 deletions
diff --git a/ChangeLog b/ChangeLog
index f91a11a..4ac6543 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-10-13 Andreas Buesching <crunchy@tzi.de>
+
+ * mpiosh/callback.c: removed the callback functions of get, put
+ and del. This work is done by mget, mput and mdel now.
+
+ * mpiosh/readline.c (mpiosh_readline_comp_mpio_file): fixed a
+ crash which ocurrs when there is no connection to the player
+ opened. Also stop readline from using default filename completion
+ in the case of not returning any results.
+
2002-10-13 Markus Germeier <mager@tzi.de>
* all operations on external memory should work now!
diff --git a/mpiosh/callback.c b/mpiosh/callback.c
index 126199d..e3f86b4 100644
--- a/mpiosh/callback.c
+++ b/mpiosh/callback.c
@@ -2,7 +2,7 @@
*
* Author: Andreas Büsching <crunchy@tzi.de>
*
- * $Id: callback.c,v 1.24 2002/10/13 12:03:51 germeier Exp $
+ * $Id: callback.c,v 1.25 2002/10/13 19:46:51 crunchy Exp $
*
* Copyright (C) 2001 Andreas Büsching <crunchy@tzi.de>
*
@@ -273,18 +273,18 @@ mpiosh_callback_get(int read, int total)
return mpiosh_cancel; // continue
}
-void
-mpiosh_cmd_get(char *args[])
-{
- MPIOSH_CHECK_CONNECTION_CLOSED;
- MPIOSH_CHECK_ARG;
+/* void */
+/* mpiosh_cmd_get(char *args[]) */
+/* { */
+/* MPIOSH_CHECK_CONNECTION_CLOSED; */
+/* MPIOSH_CHECK_ARG; */
- if (mpio_file_get(mpiosh.dev, mpiosh.card, args[0],
- mpiosh_callback_get) == -1) {
- mpio_perror("error");
- }
- printf("\n");
-}
+/* if (mpio_file_get(mpiosh.dev, mpiosh.card, args[0], */
+/* mpiosh_callback_get) == -1) { */
+/* mpio_perror("error"); */
+/* } */
+/* printf("\n"); */
+/* } */
void
mpiosh_cmd_mget(char *args[])
@@ -355,22 +355,22 @@ mpiosh_callback_put(int read, int total)
return mpiosh_cancel; // continue
}
-void
-mpiosh_cmd_put(char *args[])
-{
- int size;
+/* void */
+/* mpiosh_cmd_put(char *args[]) */
+/* { */
+/* int size; */
- MPIOSH_CHECK_CONNECTION_CLOSED;
- MPIOSH_CHECK_ARG;
+/* MPIOSH_CHECK_CONNECTION_CLOSED; */
+/* MPIOSH_CHECK_ARG; */
- if ((size = mpio_file_put(mpiosh.dev, mpiosh.card, args[0], FTYPE_MUSIC,
- mpiosh_callback_put)) == -1) {
- mpio_perror("error");
- } else {
- mpio_sync(mpiosh.dev, mpiosh.card);
- }
- printf("\n");
-}
+/* if ((size = mpio_file_put(mpiosh.dev, mpiosh.card, args[0], FTYPE_MUSIC, */
+/* mpiosh_callback_put)) == -1) { */
+/* mpio_perror("error"); */
+/* } else { */
+/* mpio_sync(mpiosh.dev, mpiosh.card); */
+/* } */
+/* printf("\n"); */
+/* } */
void
mpiosh_cmd_mput(char *args[])
@@ -451,19 +451,19 @@ mpiosh_callback_del(int read, int total)
return mpiosh_cancel; // continue
}
-void
-mpiosh_cmd_del(char *args[])
-{
- int size;
+/* void */
+/* mpiosh_cmd_del(char *args[]) */
+/* { */
+/* int size; */
- MPIOSH_CHECK_CONNECTION_CLOSED;
- MPIOSH_CHECK_ARG;
+/* MPIOSH_CHECK_CONNECTION_CLOSED; */
+/* MPIOSH_CHECK_ARG; */
- size = mpio_file_del(mpiosh.dev, mpiosh.card, args[0], mpiosh_callback_del);
- mpio_sync(mpiosh.dev, mpiosh.card);
+/* size = mpio_file_del(mpiosh.dev, mpiosh.card, args[0], mpiosh_callback_del); */
+/* mpio_sync(mpiosh.dev, mpiosh.card); */
- printf("\n");
-}
+/* printf("\n"); */
+/* } */
void
mpiosh_cmd_mdel(char *args[])
diff --git a/mpiosh/readline.c b/mpiosh/readline.c
index 5427b9f..cbff0a9 100644
--- a/mpiosh/readline.c
+++ b/mpiosh/readline.c
@@ -2,7 +2,7 @@
*
* Author: Andreas Büsching <crunchy@tzi.de>
*
- * $Id: readline.c,v 1.2 2002/10/12 20:06:22 crunchy Exp $
+ * $Id: readline.c,v 1.3 2002/10/13 19:46:51 crunchy Exp $
*
* Copyright (C) 2001 Andreas Büsching <crunchy@tzi.de>
*
@@ -90,6 +90,11 @@ mpiosh_readline_comp_mpio_file(const char *text, int state)
WORD year;
DWORD fsize;
+ if (mpiosh.dev == NULL) {
+ rl_attempted_completion_over = 1;
+ return NULL;
+ }
+
if (state == 0) p = mpio_directory_open(mpiosh.dev, mpiosh.card);
while ((p != NULL) && (arg == NULL)) {