Index: menus.mi =================================================================== --- menus.mi 8 Aug 2008 02:54:06 -0000 1.33 +++ menus.mi 16 Sep 2008 20:09:12 -0000 @@ -59,6 +59,21 @@ { msg_prompt_win(prompt, -1, 12, 0, 0, buf, buf, size); } + +/* + * remove_slash() -- remove trailing '/', if any. + * buf = "/" is not a special case; the '/' is removed even here. + */ +static void +remove_slash(char *buf) +{ + size_t len; + + len = strlen(buf) + if (len > 0 && buf[len-1] == '/') + buf[len-1] = '\0'; +} + } default y=12, no exit, scrollable; @@ -241,9 +256,13 @@ option {src_legend(menu, MSG_Host, ftp.host);}, action { src_prompt(MSG_Host, ftp.host, sizeof ftp.host); }; option {src_legend(menu, MSG_Base_dir, ftp.dir);}, - action { src_prompt(MSG_Base_dir, ftp.dir, sizeof ftp.dir); }; + action { src_prompt(MSG_Base_dir, ftp.dir, sizeof ftp.dir); + remove_slash(ftp.dir); + }; option {src_legend(menu, MSG_Set_dir, set_dir);}, - action { src_prompt(MSG_Set_dir, set_dir, sizeof set_dir); }; + action { src_prompt(MSG_Set_dir, set_dir, sizeof set_dir); + remove_slash(set_dir); + }; option {src_legend(menu, MSG_User, ftp.user);}, action { src_prompt(MSG_User, ftp.user, sizeof ftp.user); ftp.pass[0] = 0; @@ -269,7 +288,9 @@ } }; option {src_legend(menu, MSG_Xfer_dir, xfer_dir);}, - action { src_prompt(MSG_Xfer_dir, xfer_dir, sizeof xfer_dir); }; + action { src_prompt(MSG_Xfer_dir, xfer_dir, sizeof xfer_dir); + remove_slash(xfer_dir); + }; option {src_legend(menu, MSG_delete_xfer_file, clean_xfer_dir ? MSG_Yes : MSG_No);}, action {process_menu(MENU_yesno, deconst(MSG_delete_xfer_file)); @@ -281,9 +302,13 @@ option {src_legend(menu, MSG_Host, nfs_host);}, action { src_prompt(MSG_Host, nfs_host, sizeof nfs_host); }; option {src_legend(menu, MSG_Base_dir, nfs_dir);}, - action { src_prompt(MSG_Base_dir, nfs_dir, sizeof nfs_dir); }; + action { src_prompt(MSG_Base_dir, nfs_dir, sizeof nfs_dir); + remove_slash(nfs_dir); + }; option {src_legend(menu, MSG_Set_dir, set_dir);}, - action { src_prompt(MSG_Set_dir, set_dir, sizeof set_dir); }; + action { src_prompt(MSG_Set_dir, set_dir, sizeof set_dir); + remove_slash(set_dir); + }; menu fdremount, title MSG_What_do_you_want_to_do; option MSG_Try_again, exit, action { *(int *)arg = SET_CONTINUE; }; @@ -315,7 +340,9 @@ action { src_prompt(MSG_dev, fd_dev, sizeof fd_dev); }; option {src_legend(menu, MSG_fd_type, fd_type);}, sub menu fd_type; option {src_legend(menu, MSG_Xfer_dir, xfer_dir);}, - action { src_prompt(MSG_Xfer_dir, xfer_dir, sizeof xfer_dir); }; + action { src_prompt(MSG_Xfer_dir, xfer_dir, sizeof xfer_dir); + remove_slash(ftp.dir); + }; option {src_legend(menu, MSG_delete_xfer_file, clean_xfer_dir ? MSG_Yes : MSG_No);}, action {process_menu(MENU_yesno, deconst(MSG_delete_xfer_file)); @@ -326,7 +353,9 @@ option {src_legend(menu, MSG_Device, cdrom_dev);}, action { src_prompt(MSG_dev, cdrom_dev, sizeof cdrom_dev); }; option {src_legend(menu, MSG_Set_dir, set_dir);}, - action { src_prompt(MSG_Set_dir, set_dir, sizeof set_dir); }; + action { src_prompt(MSG_Set_dir, set_dir, sizeof set_dir); + remove_slash(set_dir); + }; menu localfssource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue; display action { msg_display(MSG_localfssource); }; @@ -335,16 +364,24 @@ option {src_legend(menu, MSG_File_system, localfs_fs);}, action { src_prompt(MSG_filesys, localfs_fs, sizeof localfs_fs); }; option {src_legend(menu, MSG_Base_dir, localfs_dir);}, - action { src_prompt(MSG_Base_dir, localfs_dir, sizeof localfs_dir);}; + action { src_prompt(MSG_Base_dir, localfs_dir, sizeof localfs_dir); + remove_slash(localfs_dir); + }; option {src_legend(menu, MSG_Set_dir, set_dir);}, - action { src_prompt(MSG_Set_dir, set_dir, sizeof set_dir); }; + action { src_prompt(MSG_Set_dir, set_dir, sizeof set_dir); + remove_slash(set_dir); + }; menu localdirsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue; display action { msg_display(MSG_localdir); }; option {src_legend(menu, MSG_Base_dir, localfs_dir);}, - action { src_prompt(MSG_Base_dir, localfs_dir, 60); }; + action { src_prompt(MSG_Base_dir, localfs_dir, 60); + remove_slash(localfs_dir); + }; option {src_legend(menu, MSG_Set_dir, set_dir);}, - action { src_prompt(MSG_Set_dir, set_dir, 60); }; + action { src_prompt(MSG_Set_dir, set_dir, 60); + remove_slash(set_dir); + }; menu namesrv6, title MSG_Select_IPv6_DNS_server; option "ns9.iij.ad.jp", exit, action