diff --git a/src/subshell/common.c b/src/subshell/common.c
index abea936..ab03e8a 100644
a
|
b
|
subshell_name_quote (const char *s) |
1261 | 1261 | return ret; |
1262 | 1262 | } |
1263 | 1263 | |
| 1264 | /* --------------------------------------------------------------------------------------------- */ |
| 1265 | /** |
| 1266 | * This function checks the pipe from which we receive data |
| 1267 | * about the current working directory. If there is any data |
| 1268 | * waiting, we clear it. |
| 1269 | */ |
| 1270 | |
| 1271 | static void |
| 1272 | clear_cwd_pipe (void) |
| 1273 | { |
| 1274 | fd_set read_set; |
| 1275 | |
| 1276 | struct timeval wtime = {0, 0}; |
| 1277 | |
| 1278 | int maxfdp; |
| 1279 | |
| 1280 | FD_ZERO (&read_set); |
| 1281 | FD_SET (subshell_pipe[READ], &read_set); |
| 1282 | maxfdp = subshell_pipe[READ]; |
| 1283 | if (select (maxfdp + 1, &read_set, NULL, NULL, &wtime) > 0) |
| 1284 | { |
| 1285 | |
| 1286 | if (FD_ISSET (subshell_pipe[READ], &read_set)) |
| 1287 | { |
| 1288 | if (read (subshell_pipe[READ], subshell_cwd, sizeof (subshell_cwd)) <= 0) |
| 1289 | { |
| 1290 | tcsetattr (STDOUT_FILENO, TCSANOW, &shell_mode); |
| 1291 | fprintf (stderr, "read (subshell_pipe[READ]...): %s\r\n", |
| 1292 | unix_error_string (errno)); |
| 1293 | exit (EXIT_FAILURE); |
| 1294 | } |
| 1295 | synchronize (); |
| 1296 | } |
| 1297 | } |
| 1298 | } |
| 1299 | |
1264 | 1300 | /* --------------------------------------------------------------------------------------------- */ |
1265 | 1301 | /*** public functions ****************************************************************************/ |
1266 | 1302 | /* --------------------------------------------------------------------------------------------- */ |
… |
… |
invoke_subshell (const char *command, int how, vfs_path_t ** new_dir_vpath) |
1468 | 1504 | feed_subshell (QUIETLY, FALSE); |
1469 | 1505 | } |
1470 | 1506 | } |
| 1507 | else |
| 1508 | clear_cwd_pipe (); |
| 1509 | |
1471 | 1510 | |
1472 | 1511 | if (how == QUIETLY) |
1473 | 1512 | write_all (mc_global.tty.subshell_pty, " ", 1); |