Ticket #1049: args_expand.patch

File args_expand.patch, 686 bytes (added by cafebabe@…, 18 years ago)

expand properties passed to RUN command

  • command.c

     
    30583058            }
    30593059            break;
    30603060
    3061         case MP_CMD_RUN:
     3061        case MP_CMD_RUN:{
    30623062#ifndef __MINGW32__
    3063             if (!fork()) {
    3064                 execl("/bin/sh", "sh", "-c", cmd->args[0].v.s, NULL);
    3065                 exit(0);
     3063                char *txt = NULL;
     3064                txt = m_properties_expand_string(mp_properties, cmd->args[0].v.s, mpctx);
     3065                if(txt) {
     3066                    if (!fork()) {
     3067                        execl("/bin/sh", "sh", "-c", txt, NULL);
     3068                        exit(0);
     3069                    }else{
     3070                        free(txt);
     3071                    }
     3072                }
     3073#endif
    30663074            }
    3067 #endif
    30683075            break;
    30693076
    30703077        case MP_CMD_KEYDOWN_EVENTS: