]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - contrib/libf2c/libF77/system_.c
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / contrib / libf2c / libF77 / system_.c
1 /* f77 interface to system routine */
2
3 #include "f2c.h"
4
5 #undef abs
6 #undef min
7 #undef max
8 #include <stdlib.h>
9 extern char *F77_aloc (ftnlen, char *);
10
11 integer
12 G77_system_0 (register char *s, ftnlen n)
13 {
14   char buff0[256], *buff;
15   register char *bp, *blast;
16   integer rv;
17
18   buff = bp = n < (ftnlen) sizeof (buff0) ? buff0 : F77_aloc (n + 1, "system_");
19   blast = bp + n;
20
21   while (bp < blast && *s)
22     *bp++ = *s++;
23   *bp = 0;
24   rv = system (buff);
25   if (buff != buff0)
26     free (buff);
27   return rv;
28 }