indentp.c

./driver3.2@304/indentp.c · 601 B

From the archive driver3.2@304.tar.gz

Download the archive   « Back to the archive contents

#include <stdio.h>

#if defined(AMIGA)
#include "hosts/amiga/ixfile.h"
#endif

extern char *strrchr();
extern int system();	/* Could be char* for sprintf, but... */

int
indent_program(name)
char *name;
{
    char buf[1000];
    char *p;

    if (strchr(name, '\''))
	return 0;
    p = strrchr(name, '/');
    if (!p)
	p = name;
    else
	p++;
#ifndef MSDOS
    (void) sprintf(buf, "%s/indent '%s' -lpc && rm '%s'.BAK", BINDIR, name, p);
    return (system(buf) == 0);
#else
    {
	int ec;

	(void) sprintf(buf, "indent %s -lpc", name);
	ec = system(buf);
	unlink(p);
	return(ec == 0);
    }
#endif
}

Site Stats

Snippets: 1791
Codebases: 571