X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmiracle%2Fmiracle_unit_commands.c;h=53966d46a0c939ef897395f4ed7873e0999af0c9;hb=a9f812df2a5071517dd3bb30cc80378f2e3cbe06;hp=95737f4d5d1e85cd4e699a07955dc838276d4014;hpb=a748638a86c7023aa12e7ca6e49813821fe804fd;p=melted diff --git a/src/miracle/miracle_unit_commands.c b/src/miracle/miracle_unit_commands.c index 95737f4..53966d4 100644 --- a/src/miracle/miracle_unit_commands.c +++ b/src/miracle/miracle_unit_commands.c @@ -40,6 +40,7 @@ int miracle_load( command_argument cmd_arg ) char *filename = (char*) cmd_arg->argument; char fullname[1024]; int flush = 1; + char *service; if ( filename[0] == '!' ) { @@ -47,10 +48,25 @@ int miracle_load( command_argument cmd_arg ) filename ++; } - if ( strlen( cmd_arg->root_dir ) && filename[0] == '/' ) - filename++; + service = strchr( filename, ':' ); + if ( service != NULL ) + { + service = filename; + filename = strchr( service, ':' ); + *filename ++ = '\0'; + + if ( strlen( cmd_arg->root_dir ) && filename[0] == '/' ) + filename++; + + snprintf( fullname, 1023, "%s:%s%s", service, cmd_arg->root_dir, filename ); + } + else + { + if ( strlen( cmd_arg->root_dir ) && filename[0] == '/' ) + filename++; - snprintf( fullname, 1023, "%s%s", cmd_arg->root_dir, filename ); + snprintf( fullname, 1023, "%s%s", cmd_arg->root_dir, filename ); + } if (unit == NULL) return RESPONSE_INVALID_UNIT;