1
1

* cmd.c (mkdir_cmd): Don't try to create a directory with empty

name.
Этот коммит содержится в:
Pavel Roskin 2002-12-16 02:12:22 +00:00
родитель 857565ca21
Коммит 382930fbf6
2 изменённых файлов: 17 добавлений и 11 удалений

Просмотреть файл

@ -1,5 +1,8 @@
2002-12-15 Pavel Roskin <proski@gnu.org> 2002-12-15 Pavel Roskin <proski@gnu.org>
* cmd.c (mkdir_cmd): Don't try to create a directory with empty
name.
* global.h: Add replacement for O_NONBLOCK. * global.h: Add replacement for O_NONBLOCK.
2002-12-11 Pavel Roskin <proski@gnu.org> 2002-12-11 Pavel Roskin <proski@gnu.org>

Просмотреть файл

@ -362,24 +362,27 @@ void ren_cmd_local (void)
} }
} }
void mkdir_cmd (void) void
mkdir_cmd (void)
{ {
char *tempdir; char *tempdir;
char *dir; char *dir;
dir = input_expand_dialog (_("Create a new Directory"), _(" Enter directory name:") , ""); dir =
input_expand_dialog (_("Create a new Directory"),
if (!dir) _(" Enter directory name:"), "");
if (!dir || !*dir)
return; return;
if (dir [0] && (dir [0] == '/' || dir [0] == '~')) if (dir[0] == '/' || dir[0] == '~')
tempdir = g_strdup (dir); tempdir = g_strdup (dir);
else else
tempdir = concat_dir_and_file (cpanel->cwd, dir); tempdir = concat_dir_and_file (cpanel->cwd, dir);
g_free (dir); g_free (dir);
save_cwds_stat (); save_cwds_stat ();
if (my_mkdir (tempdir, 0777) == 0){ if (my_mkdir (tempdir, 0777) == 0) {
update_panels (UP_OPTIMIZE, tempdir); update_panels (UP_OPTIMIZE, tempdir);
repaint_screen (); repaint_screen ();
select_item (cpanel); select_item (cpanel);