Soenke's 3 Feb 95 changes for version 1.14.

Cleaned up the makefiles a bit.

Ran ccprep on the *.c files, so that occ with -g produces good debug
code.  (Reported problem with Orca/C's #append directive.)

Fixed stat() bug when running under Orca/Shell.
This commit is contained in:
gdr 1995-02-08 05:47:59 +00:00
parent c254e15a3b
commit 89c33fa060
6 changed files with 50 additions and 16 deletions

View File

@ -3,7 +3,7 @@
# Copyright (c) 1993-1994 Soenke Behrens
# For use with dmake
#
# $Id: Makefile.gs,v 1.4 1995/02/08 05:25:09 gdr Exp $
# $Id: Makefile.gs,v 1.5 1995/02/08 05:47:43 gdr Exp $
#
# Define the following as necessary:
#
@ -29,10 +29,8 @@
DEFINES = -DGNO -D_POSIX_C_SOURCE -D_POSIX_SOURCE -DHAS_ATEXIT \
-DOVERFLOW_CHECK
#CFLAGS = $(DEFINES) -O -w -v -s2048
#LDFLAGS = -v -l/usr/lib/gnulib -s2048
CFLAGS = $(DEFINES) -O -v -s2048
LDFLAGS = -v -s2048
CFLAGS = $(DEFINES) -O -w -v -s2048
LDFLAGS = -v -l/usr/lib/gnulib -s2048
#
# You should not have to modify anything beyond this point

View File

@ -1,10 +1,13 @@
#ifdef __CCFRONT__
#line 2
#endif
/*
* udl - Convert EOL formats freely between MS-DOS (CR/LF), Unix/Amiga (LF),
* and Apple (CR).
*
* Routines common to both the Unix and Apple IIgs versions.
*
* $Id: common.c,v 1.4 1995/02/08 05:25:15 gdr Exp $
* $Id: common.c,v 1.5 1995/02/08 05:47:48 gdr Exp $
*
* Copyright (c) 1993-1995 Soenke Behrens, Devin Glyn Reade
*/
@ -857,16 +860,35 @@ char *mktemp(const char *base)
*p1 = 'A';
p1--;
} else {
*p1++;
*p1 += 1;
break;
}
/* Make sure the file name does not already exist */
if (stat(st,&tstat) == 0)
{
#ifdef GNO
if (needsgno() == TRUE) {
#endif
if (stat(st,&tstat) == 0)
{
free (st);
st = mktemp (base);
}
#ifdef GNO
} else { /* ORCA/Shell doesn't like stat one little bit */
FILE *fp;
if ((fp = fopen(st,"r")) != NULL)
{
fclose(fp);
free (st);
st = mktemp (base);
} else if ((fp = fopen(st,"a")) == NULL) {
free(st);
st = mktemp (base);
} else {
fclose(fp);
}
}
#endif
return st;
}
@ -888,7 +910,7 @@ char *get_path (const char *name)
strcpy(filebuffer, name);
for (i = strlen(filebuffer) - 1; i >= 0 && filebuffer[i] != dirbrk; i--)
for (i = strlen(filebuffer) - 1; i > 0 && filebuffer[i] != dirbrk; i--)
; /* empty loop to find end of path in name */
if (i != 0)

View File

@ -1,10 +1,13 @@
#ifdef __CCFRONT__
#line 2
#endif
/*
* udl - Convert EOL formats freely between MS-DOS (CR/LF), Unix/Amiga (LF),
* and Apple (CR).
*
* Contains definitions of global variables declared in common.h
*
* $Id: globals.c,v 1.1 1995/02/08 05:25:18 gdr Exp $
* $Id: globals.c,v 1.2 1995/02/08 05:47:52 gdr Exp $
*
* Copyright (c) 1993-1995 Soenke Behrens, Devin Glyn Reade
*/

View File

@ -1,10 +1,13 @@
#ifdef __CCFRONT__
#line 2
#endif
/*
* udl - Convert EOL formats freely between MS-DOS (CR/LF), Unix/Amiga (LF),
* and Apple (CR).
*
* Apple IIgs specific routines.
*
* $Id: udlgs.c,v 1.4 1995/02/08 05:25:22 gdr Exp $
* $Id: udlgs.c,v 1.5 1995/02/08 05:47:55 gdr Exp $
*
* Copyright (c) 1993-1995 Soenke Behrens, Devin Glyn Reade
*/
@ -183,7 +186,9 @@ int main(int argc,char *argv[]) {
} else {
InitWild.flags = 0;
}
dirbrk = ':'; /* enforced by NextWildcardGS */
/* loop through all command line args */
for (; optind < argc; optind++) {
size_t i;
@ -259,7 +264,7 @@ int main(int argc,char *argv[]) {
infile = tryopen(current_file,"rwb");
tempfile = mktemp(strcat(get_path(current_file), "udltmpXX"));
outfile = tryopen(tempfile,"wb");
if (careful) {
converted = TRUE; /* always */

View File

@ -1,10 +1,13 @@
#ifdef __CCFRONT__
#line 2
#endif
/*
* udl - Convert EOL formats freely between MS-DOS (CR/LF), Unix/Amiga (LF),
* and Apple (CR).
*
* Unix specific routines.
*
* $Id: udlunix.c,v 1.4 1995/02/08 05:25:24 gdr Exp $
* $Id: udlunix.c,v 1.5 1995/02/08 05:47:57 gdr Exp $
*
* Copyright (c) 1993-1995 Soenke Behrens, Devin Glyn Reade
*/

View File

@ -1,10 +1,13 @@
#ifdef __CCFRONT__
#line 2
#endif
/*
* udl - Convert EOL formats freely between MS-DOS (CR/LF), Unix/Amiga (LF),
* and Apple (CR).
*
* Usage strings.
*
* $Id: udluse.c,v 1.4 1995/02/08 05:25:26 gdr Exp $
* $Id: udluse.c,v 1.5 1995/02/08 05:47:59 gdr Exp $
*
* Copyright (c) 1993-1995 Soenke Behrens, Devin Glyn Reade
*/