diff options
author | Larry Rosenman <ler@FreeBSD.org> | 2017-10-13 00:37:31 +0000 |
---|---|---|
committer | Larry Rosenman <ler@FreeBSD.org> | 2017-10-13 00:37:31 +0000 |
commit | f38c70f1790cd3256aca816f3187012e7690f7a5 (patch) | |
tree | 83fe6056a015e4d636786dcdd3855e2c67dfe00f /math/rexx-regmath/files/patch-rxmath.c | |
parent | multimedia/qt5-multimedia: Use option helpers and turn on ALSA option by (diff) |
New port: math/rexx-regmath
regmath contains two different implementations of math libraries for the REXX language.
PR: 221573
Submitted by: bob@eager.cx
Notes
Notes:
svn path=/head/; revision=451939
Diffstat (limited to 'math/rexx-regmath/files/patch-rxmath.c')
-rw-r--r-- | math/rexx-regmath/files/patch-rxmath.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/math/rexx-regmath/files/patch-rxmath.c b/math/rexx-regmath/files/patch-rxmath.c new file mode 100644 index 000000000000..fc70ad9c4fcf --- /dev/null +++ b/math/rexx-regmath/files/patch-rxmath.c @@ -0,0 +1,42 @@ +--- rxmath.c.orig 2001-11-04 22:23:42 UTC ++++ rxmath.c +@@ -116,8 +116,8 @@ static rxfunc(trigfunc1) + rxstrdup(arg, argv[0]); + + /* argument might be in degrees or grades */ +- if (argc > 2) { +- switch (argv[2].strptr[0]) { ++ if (argc > 1 && argv[1].strptr != NULL) { ++ switch (argv[1].strptr[0]) { + /* degrees -- convert to radians */ + case 'd': + case 'D': +@@ -144,7 +144,7 @@ static rxfunc(trigfunc1) + argval = atof(arg) * PI/180.; + } + +- result->strlength = setresult(result->strptr, theFunc->fnptr(argval), argc - 1, argv+1); ++ result->strlength = setresult(result->strptr, theFunc->fnptr(argval), argc - 2, argv+2); + + return 0; + +@@ -170,8 +170,8 @@ static rxfunc(trigfunc2) + res = theFunc->fnptr(atof(arg)); + + /* result could be needed in degrees or grades */ +- if (argc > 2) { +- switch (argv[2].strptr[0]) { ++ if (argc > 1 && argv[1].strptr != NULL) { ++ switch (argv[1].strptr[0]) { + /* degrees -- convert radians to degrees */ + case 'd': + case 'D': +@@ -198,7 +198,7 @@ static rxfunc(trigfunc2) + res *= 180./PI; + } + +- result->strlength = setresult(result->strptr, res, argc - 1, argv+1); ++ result->strlength = setresult(result->strptr, res, argc - 2, argv+2); + + return 0; + } |