/*
 *	osexec
 *
 *    Copyright (C) 2000-2022 GFD Dennou Club. All rights reserved.
 *
 */

#include <stdlib.h>
#include <string.h>

#ifndef WINDOWS
void osexec_(char *cmd, int Lcmd)
#else
void OSEXEC(char *cmd, int Lcmd)
#endif

{
    int nc;
    char cmdx[80];
    int retc;

    memcpy (cmdx, cmd, Lcmd);
    for (nc = Lcmd; nc > 0; --nc)
	if (*(cmd + nc - 1) != '\0' && *(cmd + nc - 1) != ' ')
	    break;
    cmdx[nc] = '\0';
    retc=system (cmdx);
}
