Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.x'
Browse files Browse the repository at this point in the history
    - Merge changes from v1.4.3
  • Loading branch information
dharple committed Jul 24, 2021
2 parents 8671036 + 4aebc88 commit cefb75b
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/regress-1.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
run: make
- name: make check
run: make check
- name: legacy unit tests
run: ./tests/test.sh src/detox
- name: make distcheck
run: make distcheck

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ a.out

# Built Packages
/detox-*.tar.gz
/detox-*.tar.bz2
/detox-*.zip

# Coverage files
*.gcda
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- UTF-8 encoded NULL (0x0000) values are converted to `_hidden_null_` to make
them obvious. [#40]

## [1.4.3] - 2021-07-24
### Fixed
- Fixed build when the `stat` struct is missing `st_blocks`. [#77]

## [1.4.2] - 2021-03-06
### Fixed
- Replaced instances of `cp -an` with `test` and `install` in the Makefile rule
Expand Down Expand Up @@ -219,7 +223,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Initial release

[Unreleased]: https://github.com/dharple/detox/compare/v2.0.0-beta1...main
[2.0.0-beta1]: https://github.com/dharple/detox/compare/v1.4.2...v2.0.0-beta1
[2.0.0-beta1]: https://github.com/dharple/detox/compare/v1.4.3...v2.0.0-beta1
[1.4.3]: https://github.com/dharple/detox/compare/v1.4.2...v1.4.3
[1.4.2]: https://github.com/dharple/detox/compare/v1.4.1...v1.4.2
[1.4.1]: https://github.com/dharple/detox/compare/v1.4.0...v1.4.1
[1.4.0]: https://github.com/dharple/detox/compare/v1.3.3...v1.4.0
Expand All @@ -230,6 +235,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
[1.2.1]: https://github.com/dharple/detox/compare/v1.2.0...v1.2.1
[1.2.0]: https://github.com/dharple/detox/releases/tag/v1.2.0

[#77]: https://github.com/dharple/detox/issues/77
[#74]: https://github.com/dharple/detox/issues/74
[#73]: https://github.com/dharple/detox/issues/73
[#72]: https://github.com/dharple/detox/issues/72
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ AM_PROG_LEX
AC_PROG_YACC

AC_CHECK_FUNCS([getopt_long])
AC_STRUCT_ST_BLOCKS

AC_CHECK_PROGS([MANDOC], [mandoc])
AM_CONDITIONAL([MANDOC_INSTALLED], [test -n "$MANDOC"])
Expand Down
37 changes: 37 additions & 0 deletions src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,43 @@
/* Define to 1 if you have the `getopt_long' function. */
#undef HAVE_GETOPT_LONG

/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H

/* Define if you have libcheck */
#undef HAVE_LIBCHECK

/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H

/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H

/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H

/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H

/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H

/* Define to 1 if `st_blocks' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLOCKS

/* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use
`HAVE_STRUCT_STAT_ST_BLOCKS' instead. */
#undef HAVE_ST_BLOCKS

/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H

/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H

/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H

/* Name of package */
#undef PACKAGE

Expand All @@ -30,6 +64,9 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION

/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS

/* Define if you want to support coverage tests */
#undef SUPPORT_COVERAGE

Expand Down
15 changes: 10 additions & 5 deletions src/parse_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "table.h"
#include "wrapped.h"

#define LINE_LENGTH 6

enum {
BASE_STATE,
INSIDE_STATE
Expand Down Expand Up @@ -49,13 +51,16 @@ table_t *parse_table(char *filename)
system_ctype = ""; // I don't think we can free the return from setlocale()
}

size = 0;

if (table_stat.st_size > 0) {
size = table_stat.st_size;
} else {
size = (512 * table_stat.st_blocks);
size = table_stat.st_size / LINE_LENGTH;
}

size /= 6;
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
else {
size = (512 * table_stat.st_blocks) / LINE_LENGTH;
}
#endif

if (size < 500) {
size = 500;
Expand Down

0 comments on commit cefb75b

Please sign in to comment.