break;
case ALT_R: /* rename */
current = list[panel]->tab + windir[panel]->index;
- len = (strlen (current->name) > MAXFNAME * 80 / 100) ? 2 * MAXFNAME + 1: MAXFNAME + 1;
- string = getwindow ("Rename", winscreen, MAXFNAME / 2, len, current->name);
- if (string) {
- if (strchr (string, *SEPARATOR) != NULL) {
- char *buf = strdupcat ("Can't rename file to '", string, "'", NULL);
- errorwindow (buf, winscreen);
- free (buf);
- } else {
- char *src = newfilename (dirname[panel], current->name);
- char *dest = newfilename (dirname[panel], string);
- char *msg = processmove (dest, src);
- if (msg) {
- errorwindow (msg, winscreen);
- free (msg);
+ if (strcmp (current->name, "..") != 0) {
+ len = (strlen (current->name) > MAXFNAME * 80 / 100) ? 2 * MAXFNAME + 1: MAXFNAME + 1;
+ string = getwindow ("Rename", winscreen, MAXFNAME / 2, len, current->name);
+ if (string) {
+ if (strchr (string, *SEPARATOR) != NULL) {
+ char *buf = strdupcat ("Can't rename file to '", string, "'", NULL);
+ errorwindow (buf, winscreen);
+ free (buf);
+ } else {
+ char *src = newfilename (dirname[panel], current->name);
+ char *dest = newfilename (dirname[panel], string);
+ char *msg = processmove (dest, src);
+ if (msg) {
+ errorwindow (msg, winscreen);
+ free (msg);
+ }
+ free (src);
+ free (dest);
+ freelist (list[panel]);
+ list[panel] = NULL;
}
- free (src);
- free (dest);
- freelist (list[panel]);
- list[panel] = NULL;
+ free (string);
}
- free (string);
}
break;
case ALT_S: /* select */