home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource4
/
239_01
/
xeq.c
< prev
Wrap
Text File
|
1987-07-31
|
1KB
|
42 lines
/* xeq.c - a module for io.lib, 8/29/86, dco
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <direct.h>
void xeq( dir, xeqf ) char *dir, *xeqf;
{
static char *wd;
wd = getcwd( NULL, 51 );
if ( xeqf != NULL ) /* is there an exec file? */
{
if ( strlen( xeqf ) != 0 )
{
if ( dir == NULL ) dir = wd;
else if ( strlen( dir ) == 0 ) dir = wd;
if ( chdir( dir ) == -1 )
{
perror("Dir Error");
}
else
{
if ( system( xeqf ) == -1 )
{
perror("Xeq Error"); /* command.com not found */
}
/* else command.com goes to work... */
/* ...and we return here! */
}
}
}
chdir( wd );
free( wd );
}
/* eof: xeq.c */