Browse Source

Make it build, fix some things

pull/1/head
Dashie der otter 8 years ago
parent
commit
26bb7e79bf
9 changed files with 21 additions and 9 deletions
  1. 2
    0
      .gitignore
  2. 1
    1
      Makefile
  3. 3
    1
      cmd.h
  4. 1
    1
      config.h
  5. 6
    0
      perl.h
  6. 2
    2
      perly.c
  7. 1
    1
      stab.c
  8. 5
    2
      util.c
  9. 0
    1
      util.h

+ 2
- 0
.gitignore View File

@@ -1 +1,3 @@
*.o
perl
perl.c

+ 1
- 1
Makefile View File

@@ -40,7 +40,7 @@ addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
$(CC) -c $(CFLAGS) $(LARGE) $*.c

all: $(public) $(private) $(util)
touch all
echo "done"

perl: $(obj) perl.o
$(CC) $(LDFLAGS) $(obj) perl.o $(libs) -o perl

+ 3
- 1
cmd.h View File

@@ -114,7 +114,9 @@ EXT CMD *eval_root INIT(Nullcmd);
EXT struct compcmd {
CMD *comp_true;
CMD *comp_alt;
};
} foo; /* rhaamo: foo required or will get:
* warning: useless storage class specifier in empty declaration!
*/

#ifndef DOINIT
extern struct compcmd Nullccmd;

+ 1
- 1
config.h View File

@@ -98,7 +98,7 @@
* is up to the package author to declare things correctly based on the
* symbol.
*/
#define VOIDSIG /**/
//#define VOIDSIG /**/

/* STDCHAR:
* This symbol is defined to be the type of char used in stdio.h.

+ 6
- 0
perl.h View File

@@ -42,6 +42,12 @@

#include <sys/times.h>

/* Avoid implicit bla */
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>

typedef struct arg ARG;
typedef struct cmd CMD;
typedef struct formcmd FCMD;

+ 2
- 2
perly.c View File

@@ -51,8 +51,8 @@ register char **env;
#endif
case 'e':
if (!e_fp) {
mktemp(e_tmpname);
e_fp = fopen(e_tmpname,"w");
/* rhaamo: use mkostemp instead of mktemp + fopen */
e_fp = mkostemp(e_tmpname, "w");
}
if (argv[1])
fputs(argv[1],e_fp);

+ 1
- 1
stab.c View File

@@ -240,7 +240,7 @@ STR *str;
}
}
else if (stab == envstab && envname) {
setenv(envname,str_get(str));
setenv(envname,str_get(str),1); /* rhaamo: added 1 (overwrite) */
/* And you'll never guess what the dog had */
safefree(envname); /* in its mouth... */
envname = Nullch;

+ 5
- 2
util.c View File

@@ -32,7 +32,7 @@ safemalloc(size)
MEM_SIZE size;
{
char *ptr;
char *malloc();
void *malloc(); /* rhaamo: void, not char */

ptr = malloc(size?size:1); /* malloc(0) is NASTY on our system */
#ifdef DEBUGGING
@@ -56,7 +56,7 @@ char *where;
MEM_SIZE size;
{
char *ptr;
char *realloc();
void *realloc(); /* rhaamo: void, not char */

ptr = realloc(where,size?size:1); /* realloc(0) is NASTY on our system */
#ifdef DEBUGGING
@@ -222,6 +222,8 @@ char *pat;
static bool firstsetenv = TRUE;
extern char **environ;

/* rhaamo: i think we can rely on the system's setenv() */
#if 0
void
setenv(nam,val)
char *nam, *val;
@@ -256,6 +258,7 @@ char *nam, *val;
/* the old environ structure */
sprintf(environ[i],"%s=%s",nam,val);/* all that work just for this */
}
#endif

int
envix(nam)

+ 0
- 1
util.h View File

@@ -28,7 +28,6 @@ void prexit();
char *get_a_line();
char *savestr();
int makedir();
void setenv();
int envix();
void notincl();
char *getval();

Loading…
Cancel
Save