summaryrefslogtreecommitdiffstats
path: root/contrib/libf2c/libU77/chmod_.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libf2c/libU77/chmod_.c')
-rw-r--r--contrib/libf2c/libU77/chmod_.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/contrib/libf2c/libU77/chmod_.c b/contrib/libf2c/libU77/chmod_.c
index d482d9e..86e620c 100644
--- a/contrib/libf2c/libU77/chmod_.c
+++ b/contrib/libf2c/libU77/chmod_.c
@@ -41,41 +41,41 @@ Boston, MA 02111-1307, USA. */
#define CHMOD_PATH "/bin/chmod"
#endif
-#ifdef KR_headers
-extern void s_cat ();
-void g_char ();
+extern void s_cat (char *lp, char *rpp[], ftnlen rnp[], ftnlen * np,
+ ftnlen ll);
+void g_char (const char *a, ftnlen alen, char *b);
-integer G77_chmod_0 (name, mode, Lname, Lmode)
- char *name, *mode;
- ftnlen Lname, Lmode;
-#else
-extern void s_cat(char *lp, char *rpp[], ftnlen rnp[], ftnlen *np, ftnlen ll);
-void g_char(const char *a, ftnlen alen, char *b);
-
-integer G77_chmod_0 (/* const */ char *name, /* const */ char *mode, const ftnlen Lname, const ftnlen Lmode)
-#endif
+integer
+G77_chmod_0 ( /* const */ char *name, /* const */ char *mode,
+ const ftnlen Lname, const ftnlen Lmode)
{
char *buff;
- char *bp, *blast;
int i;
ftnlen l, l2;
ftnlen six = 6;
address a[6];
ftnlen ii[6];
- char chmod_path [] = CHMOD_PATH;
+ char chmod_path[] = CHMOD_PATH;
l = strlen (chmod_path);
- buff = malloc (Lname+Lmode+l+3+13+1);
- if (!buff) return -1;
- ii[0] = l; a[0] = chmod_path;
- ii[1] = 1; a[1] = " ";
- ii[2] = Lmode; a[2] = mode;
- ii[3] = 2; a[3] = " '";
- for (l2=Lname; (l2 > 1) && (name[l2-1] == ' '); )
+ buff = malloc (Lname + Lmode + l + 3 + 13 + 1);
+ if (!buff)
+ return -1;
+ ii[0] = l;
+ a[0] = chmod_path;
+ ii[1] = 1;
+ a[1] = " ";
+ ii[2] = Lmode;
+ a[2] = mode;
+ ii[3] = 2;
+ a[3] = " '";
+ for (l2 = Lname; (l2 > 1) && (name[l2 - 1] == ' ');)
l2--;
- ii[4] = l2; a[4] = name;
- ii[5] = 13; a[5] = "' 2>/dev/null";
- s_cat (buff, a, ii, &six, Lname+Lmode+l+3+13);
- buff[Lname+Lmode+l+3+13] = '\0';
+ ii[4] = l2;
+ a[4] = name;
+ ii[5] = 13;
+ a[5] = "' 2>/dev/null";
+ s_cat (buff, a, ii, &six, Lname + Lmode + l + 3 + 13);
+ buff[Lname + Lmode + l + 3 + 13] = '\0';
i = system (buff);
free (buff);
return i;
OpenPOWER on IntegriCloud