From: <bms...@us...> - 2007-04-06 19:22:48
|
Revision: 2472 http://svn.sourceforge.net/morphix/?rev=2472&view=rev Author: bmsleight Date: 2007-04-06 12:22:45 -0700 (Fri, 06 Apr 2007) Log Message: ----------- retrieve wget -P or wget -O Modified Paths: -------------- trunk/mmaker/libmorphix/makemodule.c Modified: trunk/mmaker/libmorphix/makemodule.c =================================================================== --- trunk/mmaker/libmorphix/makemodule.c 2007-04-05 19:45:09 UTC (rev 2471) +++ trunk/mmaker/libmorphix/makemodule.c 2007-04-06 19:22:45 UTC (rev 2472) @@ -550,7 +550,17 @@ gchar *http_s = "http://"; if (strncmp(r->from,http_s,strlen(http_s)) == 0) { - gchar *cmdline = g_strdup_printf("wget -P %s/%s %s",module->dirname,r->to,r->from); + #If the last charactor of r->from is a / then we need wget -P else wget -O + char * pch; + char wgetopt; + pch=strrchr(r->from,'/'); + if (pch-r->from == strlen(r->from)-1) { + wgetopt='P'; + } + else { + wgetopt='O'; + } + gchar *cmdline = g_strdup_printf("wget -%c %s/%s %s",wgetopt,module->dirname,r->to,r->from); if (!ExecuteCommand(cmdline)) { fprintf(stderr,"Warning: unable to execute retrieval: %s\n",r->from); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |