--- media.c.orig 2012-02-27 19:44:23.000000000 +0900 +++ media.c 2012-02-27 20:16:55.000000000 +0900 @@ -327,39 +327,48 @@ cp = NULL; if (!cp) { if (!dmenuOpenSimple(&MenuMediaFTP, FALSE)) return DITEM_FAILURE; else cp = variable_get(VAR_FTP_PATH); } if (!cp) return DITEM_FAILURE; else if (!strcmp(cp, "other")) { + static int urlsaved = 0; + static char urlsave[sizeof(ftpDevice.name)]; + if (urlsaved) + variable_set2(VAR_FTP_PATH, urlsave, 0); + else variable_set2(VAR_FTP_PATH, "ftp://", 0); cp = variable_get_value(VAR_FTP_PATH, "Please specify the URL of a FreeBSD distribution on a\n" "remote ftp site. This site must accept either anonymous\n" "ftp or you should have set an ftp username and password\n" "in the Options screen.\n\n" "A URL looks like this: ftp:///\n" "Where is relative to the anonymous ftp directory or the\n" "home directory of the user being logged in as.", 0); if (!cp || !*cp || !strcmp(cp, "ftp://")) { + urlsaved = 0; variable_unset(VAR_FTP_PATH); return DITEM_FAILURE; } urllen = strlen(cp); if (urllen >= sizeof(ftpDevice.name)) { msgConfirm("Length of specified URL is %d characters. Allowable maximum is %d.", urllen,sizeof(ftpDevice.name)-1); + urlsaved = 0; variable_unset(VAR_FTP_PATH); return DITEM_FAILURE; } + urlsaved = 1; + strcpy(urlsave, cp); } if (strncmp("ftp://", cp, 6)) { msgConfirm("Sorry, %s is an invalid URL!", cp); variable_unset(VAR_FTP_PATH); return DITEM_FAILURE; } SAFE_STRCPY(ftpDevice.name, cp); SAFE_STRCPY(hbuf, cp + 6); hostname = hbuf;