From a14c0668720dcafde3f60b7659a01d99ec693a41 Mon Sep 17 00:00:00 2001 From: Adam Weinberger Date: Mon, 28 Jul 2014 23:33:47 +0000 Subject: Rename math/ patch-xy patches to reflect the files they modify. --- math/physcalc/files/patch-aa | 13 ------------- math/physcalc/files/patch-ab | 29 ----------------------------- math/physcalc/files/patch-ac | 21 --------------------- math/physcalc/files/patch-physcalc.h | 13 +++++++++++++ math/physcalc/files/patch-physconv.c | 29 +++++++++++++++++++++++++++++ math/physcalc/files/patch-physmain.c | 21 +++++++++++++++++++++ 6 files changed, 63 insertions(+), 63 deletions(-) delete mode 100644 math/physcalc/files/patch-aa delete mode 100644 math/physcalc/files/patch-ab delete mode 100644 math/physcalc/files/patch-ac create mode 100644 math/physcalc/files/patch-physcalc.h create mode 100644 math/physcalc/files/patch-physconv.c create mode 100644 math/physcalc/files/patch-physmain.c (limited to 'math/physcalc') diff --git a/math/physcalc/files/patch-aa b/math/physcalc/files/patch-aa deleted file mode 100644 index 96b25217a20d..000000000000 --- a/math/physcalc/files/patch-aa +++ /dev/null @@ -1,13 +0,0 @@ ---- physcalc.h Sun Aug 27 17:46:31 2000 -+++ physcalc.h.new Sun Aug 27 17:46:57 2000 -@@ -22,6 +22,10 @@ - #error This program requires more memory than the tiny model allows! - #endif - -+#ifndef SHAREDIR -+#define SHAREDIR "/usr/share/physcalc/" -+#endif -+ - #define VERSION "2.4" /* Version number */ - #define TRACE - diff --git a/math/physcalc/files/patch-ab b/math/physcalc/files/patch-ab deleted file mode 100644 index 179a6a6b4eac..000000000000 --- a/math/physcalc/files/patch-ab +++ /dev/null @@ -1,29 +0,0 @@ ---- physconv.c.orig 1998-08-30 15:58:16.000000000 -0500 -+++ physconv.c 2009-06-25 22:22:21.000000000 -0500 -@@ -260,12 +260,16 @@ - { /* read in lines from fp and do each as if typed from console */ - FILE *fp; - char buf[SMALLBUF]; -+ char *fullpath; - int oldecho; - #ifdef TRACE - int oldtrace; - #endif - -- if ((fp = fopen(s,"r"))==NULL) { -+ fullpath = calloc( strlen( SHAREDIR ) + strlen( s ) + 1, 1 ); -+ bcopy(SHAREDIR, fullpath, strlen(SHAREDIR)); -+ (void) strcat(fullpath, s); -+ if ((fp = fopen(fullpath,"r"))==NULL) { - printf("Can't open %s\n",s); - return; - } -@@ -797,7 +801,7 @@ - } else { - showdims(&d); - printf("Convert to: "); -- gets(buf); -+ fgets(buf, sizeof(buf), stdin); - trimspc(buf); - if (buf[0]=='?') { - showdims(&d); diff --git a/math/physcalc/files/patch-ac b/math/physcalc/files/patch-ac deleted file mode 100644 index c76d57866f58..000000000000 --- a/math/physcalc/files/patch-ac +++ /dev/null @@ -1,21 +0,0 @@ ---- physmain.c.orig 1998-08-30 14:48:34.000000000 -0500 -+++ physmain.c 2009-06-25 22:32:46.000000000 -0500 -@@ -227,7 +227,7 @@ - printf("Replace %s = ",v->name); - printexpr(v->value); - printf(" ?"); -- gets(answer); -+ fgets(answer, sizeof(answer), stdin); - printf("\n"); - } else - answer[0] = 'Y'; -@@ -711,7 +711,8 @@ - } else - while (TRUE) { - printf(">"); -- gets(buf); -+ if(fgets(buf, sizeof(buf), stdin) == NULL) -+ exit(0); - do_cmd(buf); - } - } diff --git a/math/physcalc/files/patch-physcalc.h b/math/physcalc/files/patch-physcalc.h new file mode 100644 index 000000000000..96b25217a20d --- /dev/null +++ b/math/physcalc/files/patch-physcalc.h @@ -0,0 +1,13 @@ +--- physcalc.h Sun Aug 27 17:46:31 2000 ++++ physcalc.h.new Sun Aug 27 17:46:57 2000 +@@ -22,6 +22,10 @@ + #error This program requires more memory than the tiny model allows! + #endif + ++#ifndef SHAREDIR ++#define SHAREDIR "/usr/share/physcalc/" ++#endif ++ + #define VERSION "2.4" /* Version number */ + #define TRACE + diff --git a/math/physcalc/files/patch-physconv.c b/math/physcalc/files/patch-physconv.c new file mode 100644 index 000000000000..179a6a6b4eac --- /dev/null +++ b/math/physcalc/files/patch-physconv.c @@ -0,0 +1,29 @@ +--- physconv.c.orig 1998-08-30 15:58:16.000000000 -0500 ++++ physconv.c 2009-06-25 22:22:21.000000000 -0500 +@@ -260,12 +260,16 @@ + { /* read in lines from fp and do each as if typed from console */ + FILE *fp; + char buf[SMALLBUF]; ++ char *fullpath; + int oldecho; + #ifdef TRACE + int oldtrace; + #endif + +- if ((fp = fopen(s,"r"))==NULL) { ++ fullpath = calloc( strlen( SHAREDIR ) + strlen( s ) + 1, 1 ); ++ bcopy(SHAREDIR, fullpath, strlen(SHAREDIR)); ++ (void) strcat(fullpath, s); ++ if ((fp = fopen(fullpath,"r"))==NULL) { + printf("Can't open %s\n",s); + return; + } +@@ -797,7 +801,7 @@ + } else { + showdims(&d); + printf("Convert to: "); +- gets(buf); ++ fgets(buf, sizeof(buf), stdin); + trimspc(buf); + if (buf[0]=='?') { + showdims(&d); diff --git a/math/physcalc/files/patch-physmain.c b/math/physcalc/files/patch-physmain.c new file mode 100644 index 000000000000..c76d57866f58 --- /dev/null +++ b/math/physcalc/files/patch-physmain.c @@ -0,0 +1,21 @@ +--- physmain.c.orig 1998-08-30 14:48:34.000000000 -0500 ++++ physmain.c 2009-06-25 22:32:46.000000000 -0500 +@@ -227,7 +227,7 @@ + printf("Replace %s = ",v->name); + printexpr(v->value); + printf(" ?"); +- gets(answer); ++ fgets(answer, sizeof(answer), stdin); + printf("\n"); + } else + answer[0] = 'Y'; +@@ -711,7 +711,8 @@ + } else + while (TRUE) { + printf(">"); +- gets(buf); ++ if(fgets(buf, sizeof(buf), stdin) == NULL) ++ exit(0); + do_cmd(buf); + } + } -- cgit v1.2.3