summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2012-09-27 19:20:09 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2012-09-27 19:20:09 (GMT)
commit32a131ea70f988d35bed87631c9cec68b2388ba5 (patch)
treeafbd278b07db75df7e40393095b41128569e40b8 /fortran
parenta81cc2ac7ef875999f01a91a9a492e19da94ce56 (diff)
downloadhdf5-32a131ea70f988d35bed87631c9cec68b2388ba5.zip
hdf5-32a131ea70f988d35bed87631c9cec68b2388ba5.tar.gz
hdf5-32a131ea70f988d35bed87631c9cec68b2388ba5.tar.bz2
[svn-r22825] Fix for: HDFFV-7903 Fortran problem writing control character to a dataset
Tested: (jam, gfortran)
Diffstat (limited to 'fortran')
-rw-r--r--fortran/Makefile.in2
-rw-r--r--fortran/examples/Makefile.in2
-rw-r--r--fortran/src/H5f90kit.c2
-rw-r--r--fortran/src/Makefile.in2
-rw-r--r--fortran/test/Makefile.in2
-rw-r--r--fortran/test/fortranlib_test_F03.f904
-rw-r--r--fortran/test/tH5T_F03.f9041
-rw-r--r--fortran/testpar/Makefile.in2
8 files changed, 46 insertions, 11 deletions
diff --git a/fortran/Makefile.in b/fortran/Makefile.in
index 888736a..806eb30 100644
--- a/fortran/Makefile.in
+++ b/fortran/Makefile.in
@@ -219,7 +219,6 @@ FILTERS = @FILTERS@
FSEARCH_DIRS = @FSEARCH_DIRS@
GPFS = @GPFS@
GREP = @GREP@
-H5BLD_STATIC = @H5BLD_STATIC@
H5_CFLAGS = @H5_CFLAGS@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
@@ -234,7 +233,6 @@ HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
-HDF5_USE_SHLIB = @HDF5_USE_SHLIB@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_FORTRAN2003 = @HDF_FORTRAN2003@
diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in
index 5da455b..06c2632 100644
--- a/fortran/examples/Makefile.in
+++ b/fortran/examples/Makefile.in
@@ -190,7 +190,6 @@ FILTERS = @FILTERS@
FSEARCH_DIRS = @FSEARCH_DIRS@
GPFS = @GPFS@
GREP = @GREP@
-H5BLD_STATIC = @H5BLD_STATIC@
H5_CFLAGS = @H5_CFLAGS@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
@@ -205,7 +204,6 @@ HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
-HDF5_USE_SHLIB = @HDF5_USE_SHLIB@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_FORTRAN2003 = @HDF_FORTRAN2003@
diff --git a/fortran/src/H5f90kit.c b/fortran/src/H5f90kit.c
index 059685e..0bc721f 100644
--- a/fortran/src/H5f90kit.c
+++ b/fortran/src/H5f90kit.c
@@ -53,7 +53,7 @@ HD5f2cstring(_fcd fdesc, size_t len)
/* Search for the end of the string */
str = _fcdtocp(fdesc);
- for(i = (int)len - 1; i >= 0 && !HDisgraph((int)str[i]); i--)
+ for(i = (int)len - 1; i >= 0 && HDisspace((int)str[i]) && str[i] == ' '; i--)
/*EMPTY*/;
/* Allocate C string */
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index 164f856..069846a5 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -307,7 +307,6 @@ FILTERS = @FILTERS@
FSEARCH_DIRS = @FSEARCH_DIRS@
GPFS = @GPFS@
GREP = @GREP@
-H5BLD_STATIC = @H5BLD_STATIC@
H5_CFLAGS = @H5_CFLAGS@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
@@ -322,7 +321,6 @@ HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
-HDF5_USE_SHLIB = @HDF5_USE_SHLIB@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_FORTRAN2003 = @HDF_FORTRAN2003@
diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in
index 33f1022..e42b080 100644
--- a/fortran/test/Makefile.in
+++ b/fortran/test/Makefile.in
@@ -290,7 +290,6 @@ FILTERS = @FILTERS@
FSEARCH_DIRS = @FSEARCH_DIRS@
GPFS = @GPFS@
GREP = @GREP@
-H5BLD_STATIC = @H5BLD_STATIC@
H5_CFLAGS = @H5_CFLAGS@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
@@ -305,7 +304,6 @@ HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
-HDF5_USE_SHLIB = @HDF5_USE_SHLIB@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_FORTRAN2003 = @HDF_FORTRAN2003@
diff --git a/fortran/test/fortranlib_test_F03.f90 b/fortran/test/fortranlib_test_F03.f90
index b674452..c8830d6 100644
--- a/fortran/test/fortranlib_test_F03.f90
+++ b/fortran/test/fortranlib_test_F03.f90
@@ -117,6 +117,10 @@ PROGRAM fortranlibtest_F03
CALL write_test_status(ret_total_error, ' Testing writing/reading string datatypes, using C_LOC', total_error)
ret_total_error = 0
+ CALL vl_test_special_char(ret_total_error)
+ CALL write_test_status(ret_total_error, ' Testing string datatypes containing control characters', total_error)
+
+ ret_total_error = 0
CALL test_create(ret_total_error)
CALL write_test_status(ret_total_error, &
' Testing filling functions', &
diff --git a/fortran/test/tH5T_F03.f90 b/fortran/test/tH5T_F03.f90
index 2cf0a84..7c99856 100644
--- a/fortran/test/tH5T_F03.f90
+++ b/fortran/test/tH5T_F03.f90
@@ -2800,6 +2800,47 @@ SUBROUTINE t_string(total_error)
END SUBROUTINE t_string
+SUBROUTINE vl_test_special_char(cleanup, total_error)
+
+ USE hdf5
+ IMPLICIT NONE
+
+ INTERFACE
+ SUBROUTINE setup_buffer(data_in, line_lengths, char_type)
+ USE hdf5
+ USE ISO_C_BINDING
+ IMPLICIT NONE
+ CHARACTER(len=*), DIMENSION(:) :: data_in
+ INTEGER(size_t), DIMENSION(:) :: line_lengths
+ CHARACTER(KIND=C_CHAR,LEN=*) :: char_type
+ END SUBROUTINE setup_buffer
+ END INTERFACE
+
+ LOGICAL, INTENT(IN) :: cleanup
+ INTEGER, INTENT(OUT) :: total_error
+
+ CHARACTER(LEN=16), PARAMETER :: filename = "t_controlchar.h5"
+ INTEGER, PARAMETER :: line_length = 10
+ INTEGER(hid_t) :: file
+ INTEGER(hid_t) :: dataset0
+ CHARACTER(len=line_length), DIMENSION(1:100) :: data_in
+ CHARACTER(len=line_length), DIMENSION(1:100) :: data_out
+ INTEGER(size_t), DIMENSION(1:100) :: line_lengths
+ INTEGER(hid_t) :: string_id, space, dcpl
+ INTEGER(hsize_t), DIMENSION(1:1) :: dims = (/0/)
+ INTEGER(hsize_t), DIMENSION(1:1) :: max_dims = (/0/)
+ INTEGER(hsize_t), DIMENSION(1:2) :: data_dims = (/0,0/)
+ INTEGER(hsize_t), DIMENSION(1:1) :: chunk =(/10/)
+ INTEGER, PARAMETER :: ncontrolchar = 7
+ CHARACTER(KIND=C_CHAR,LEN=1), DIMENSION(1:ncontrolchar) :: controlchar = &
+ (/C_ALERT, C_BACKSPACE,C_CARRIAGE_RETURN, C_FORM_FEED,C_HORIZONTAL_TAB,C_VERTICAL_TAB, C_NEW_LINE/)
+ INTEGER :: i, j, n, error
+ n = 8
+ !
+ ! Create a new file using the default properties.
+ !
+ CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file, error)
+ CALL check("h5fcreate_f",error, total_error)
!-------------------------------------------------------------------------
! Function: test_nbit
diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in
index 5faf18c..1cbc87e 100644
--- a/fortran/testpar/Makefile.in
+++ b/fortran/testpar/Makefile.in
@@ -217,7 +217,6 @@ FILTERS = @FILTERS@
FSEARCH_DIRS = @FSEARCH_DIRS@
GPFS = @GPFS@
GREP = @GREP@
-H5BLD_STATIC = @H5BLD_STATIC@
H5_CFLAGS = @H5_CFLAGS@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
@@ -232,7 +231,6 @@ HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
-HDF5_USE_SHLIB = @HDF5_USE_SHLIB@
HDF_CXX = @HDF_CXX@
HDF_FORTRAN = @HDF_FORTRAN@
HDF_FORTRAN2003 = @HDF_FORTRAN2003@