Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler error on OS X 10.6 #1465

Closed
wants to merge 3,402 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3402 commits
Select commit Hold shift + click to select a range
13f4a8c
Fix typo
krader1961 Aug 27, 2019
a724383
Move the `whence` documentation into a text file
krader1961 Aug 26, 2019
44fb5d5
Move the other builtin command docs into ext files
krader1961 Aug 26, 2019
f5ae4ee
Add comment explaining why `sh_set[]` isn't externalized
krader1961 Aug 26, 2019
a226181
Move libcmd into the ksh tree
krader1961 Aug 27, 2019
62fdca2
More builtin documention moved to external files
krader1961 Aug 26, 2019
282247d
Move more documentation out of the source code
krader1961 Aug 27, 2019
b0a1984
Lint cleanup
krader1961 Aug 28, 2019
e6e79c9
Remove deprecated cppcheck option
krader1961 Aug 28, 2019
da4f59d
cppcheck lint cleanup
krader1961 Aug 28, 2019
d0d07c6
Move b_command() into its own module
krader1961 Aug 28, 2019
2bf7a27
Refactor `export` and `readonly`
krader1961 Aug 28, 2019
3d3e417
Move b_alias() into its own module
krader1961 Aug 29, 2019
e3eb5e1
Move b_builtin() into its own module
krader1961 Aug 29, 2019
90f9b53
Move b_set() into its own module
krader1961 Aug 29, 2019
75f9c39
Move b_set() into its own module
krader1961 Aug 29, 2019
0b46d8c
Fix definition of `print_scan()` function
siteshwar Aug 29, 2019
15f781f
Make `print_scan()` function non-static
siteshwar Aug 29, 2019
13d6ace
Readd header needed on 32-bit platforms
krader1961 Aug 29, 2019
208c23d
Refactor bg_fg_disown.c
krader1961 Aug 29, 2019
7f1061c
Refactor module true_false.c
krader1961 Aug 29, 2019
6a372af
Refactor break_continue.c and return_exit.c
krader1961 Aug 29, 2019
5e0ff94
Refactor cd_pwd.c
krader1961 Aug 29, 2019
fb2e95b
Remove unsed, broken, "hash" builtin
krader1961 Aug 29, 2019
9ba9355
Enable code predicated on _c99_in_the_wild
krader1961 Aug 29, 2019
d5277d3
Refactor b_unset(), b_unalias, and unall()
krader1961 Aug 30, 2019
32d8131
Release ksh-2020.0.0-beta1
siteshwar Aug 30, 2019
0f44849
Remove dup `b_pwd()` leftover from previous refactoring
krader1961 Aug 30, 2019
36d688a
Move `sig_number()` out of trap.c
krader1961 Aug 30, 2019
990f237
Separate b_trap() and b_kill()
krader1961 Aug 30, 2019
e069b75
Eliminate pointless `Bltin()` preprocessor macro
krader1961 Aug 30, 2019
4de8a51
IWYU lint
krader1961 Aug 31, 2019
d89753b
Skip API test if build type != debug
krader1961 Sep 1, 2019
cb9f6d3
Ensure USER is set when unit tests run
krader1961 Sep 1, 2019
dc9fccc
Replace e_astbin with SH_CMDLIB_DIR
krader1961 Sep 2, 2019
a54c289
Introduce ${.sh.install_prefix}
krader1961 Sep 2, 2019
2d497fb
Make the code less fragile
krader1961 Sep 3, 2019
2bce63a
Switch to a more idiomatic end-of-table check
krader1961 Sep 3, 2019
657c587
Fix various typos found by codespell
hosiet Sep 3, 2019
a9d4bb0
Replace commit 2d497fbc with a better approach
krader1961 Sep 4, 2019
44463c0
Make b_times.exp unit test more robust
krader1961 Sep 6, 2019
24e968c
Convert `alias` documentation to Sphinx/RST
krader1961 Aug 31, 2019
fa9673c
Switch b_alias() from optget() to getopt_long()
krader1961 Sep 1, 2019
a08307c
Implement `man` function
krader1961 Sep 3, 2019
d0f92b4
Convert b_basename() to getopt_long()
krader1961 Sep 4, 2019
f4c1514
Changes to make the tests pass
krader1961 Sep 8, 2019
f124433
Cygwin source compatibility
krader1961 Sep 10, 2019
780492b
Lint: suggest parentheses around ‘&&’ within ‘||’
krader1961 Sep 11, 2019
3bd5b4f
Move b_echo() into its own module
krader1961 Sep 11, 2019
6153a5a
Fix shellcheck errors
krader1961 Sep 11, 2019
fca4d53
Switch b_bg() from optget() to getopt_long()
krader1961 Sep 11, 2019
0101139
Switch b_fg() from optget() to getopt_long()
krader1961 Sep 11, 2019
d49d8de
Switch b_break() from optget() to getopt_long()
krader1961 Sep 11, 2019
6d55cdc
Use `MESON_INSTALL_DESTDIR_PREFIX` variable
siteshwar Sep 11, 2019
9c9a5c8
[packaging] Add missing files in rpm builds
siteshwar Sep 11, 2019
244d9cc
[packaging] Fix rpm builds on opensuse
siteshwar Sep 11, 2019
ce77f93
Convert b_basename() to getopt_long()
krader1961 Sep 4, 2019
c085cbc
Introduce builtin_usage_error()
krader1961 Sep 12, 2019
d5d60da
Switch b_builtin() from optget() to getopt_long()
krader1961 Sep 11, 2019
c0abef8
Switch b_cat() from optget() to getopt_long()
krader1961 Sep 11, 2019
a2f9d59
Switch b_cd() from optget() to getopt_long()
krader1961 Sep 12, 2019
0f8af10
Switch b_chmod() from optget() to getopt_long()
krader1961 Sep 12, 2019
9487319
IWYU lint
krader1961 Sep 13, 2019
0ba0a7b
Switch b_cmp() from optget() to getopt_long()
krader1961 Sep 13, 2019
2102308
Switch b_command() from optget() to getopt_long()
krader1961 Sep 13, 2019
1687f3b
Switch to POSIXLY_CORRECT option parsing
krader1961 Sep 13, 2019
c4f582d
Fix expansion of bare tildes when HOME is unset
floppym Sep 5, 2019
6ef2ca5
make man
krader1961 Sep 13, 2019
7c174b5
Switch b_continue() from optget() to getopt_long()
krader1961 Sep 14, 2019
96b19ee
Correct which optget_long() error handling
krader1961 Sep 14, 2019
0f05131
Switch b_cut() from optget() to getopt_long()
krader1961 Sep 14, 2019
2b6e821
Don't assume `no_argument` is zero
krader1961 Sep 14, 2019
8aa6eea
Switch b_dirname() from optget() to getopt_long()
krader1961 Sep 14, 2019
b935f1a
Switch b_disown() from optget() to getopt_long()
krader1961 Sep 14, 2019
a421fe8
Switch b_source() from optget() to getopt_long()
krader1961 Sep 14, 2019
c682318
Document fix for issue #1391
krader1961 Sep 14, 2019
c44e124
Use sphinx to generate the docs if available
krader1961 Sep 14, 2019
bc155a2
Create echo.rst document
krader1961 Sep 15, 2019
c3a2b14
Switch b_enum() from optget() to getopt_long()
krader1961 Sep 15, 2019
62fd830
Man page rst cleanups
krader1961 Sep 15, 2019
9484249
Commit more Sphinx build artifacts
krader1961 Sep 15, 2019
d9491d4
Fix regression involving `command` builtin
krader1961 Sep 15, 2019
8aa9ac9
Switch b_eval() from optget() to getopt_long()
krader1961 Sep 15, 2019
1da542f
Switch b_exec() from optget() to getopt_long()
krader1961 Sep 15, 2019
e0c4882
Switch b_exit() from optget() to getopt_long()
krader1961 Sep 16, 2019
57085ad
Switch b_export() from optget() to getopt_long()
krader1961 Sep 16, 2019
c584641
Switch b_head() from optget() to getopt_long()
krader1961 Sep 16, 2019
695269a
Switch b_hist() from optget() to getopt_long()
krader1961 Sep 16, 2019
66d0976
Commit more Sphinx build artifacts
krader1961 Sep 16, 2019
1c9e7ab
Revert "Switch b_hist() from optget() to getopt_long()"
krader1961 Sep 17, 2019
91a75b9
Normalize sentinel value of a Shtable_t[]
krader1961 Sep 17, 2019
1eb928a
run_test.sh: exit with status 77 when skipping a test
floppym Sep 17, 2019
25f73f4
Initialize the jobs table earlier
krader1961 Sep 18, 2019
1893891
Switch b_hist() from optget() to getopt_long()
krader1961 Sep 19, 2019
4c9c596
Fix and normalize handling of atypical CLI flags
krader1961 Sep 19, 2019
98bc42a
Make unit test compatible with Cygwin
krader1961 Sep 19, 2019
3dffc9d
Switch b_jobs() from optget() to getopt_long()
krader1961 Sep 20, 2019
abe5bd6
Switch b_kill() from optget() to getopt_long()
krader1961 Sep 20, 2019
957ce01
Fix `exit` getopt_long() short options
krader1961 Sep 20, 2019
376b085
Fix `head` handling of integer flags
krader1961 Sep 20, 2019
abf06c2
Remove support for negative ints from `bg` and `fg`
krader1961 Sep 20, 2019
7368706
Man page style improvements
krader1961 Sep 20, 2019
c3aa2d5
Switch b_let() from optget() to getopt_long()
krader1961 Sep 20, 2019
46215d4
Switch b_logname() from optget() to getopt_long()
krader1961 Sep 21, 2019
eb8e227
Switch b_mkdir() from optget() to getopt_long()
krader1961 Sep 21, 2019
0ffecb0
man: Silence mandoc warnings in ksh.1.
orbea Sep 21, 2019
7c17e44
bin/style all
krader1961 Sep 21, 2019
7b5953c
eliminate some unused preprocessor symbols
krader1961 Sep 21, 2019
f4d7c1b
Add more `print -R` tests
krader1961 Sep 22, 2019
6993358
Refactor b_print(), b_echo(), and b_printf()
krader1961 Sep 22, 2019
08ab0ec
Remove `login` and `newgrp` special builtins
krader1961 Sep 24, 2019
1885d04
Switch b_print() from optget() to getopt_long()
krader1961 Sep 24, 2019
72e1624
Switch b_printf() from optget() to getopt_long()
krader1961 Sep 25, 2019
7f06b58
Switch b_pwd() from optget() to getopt_long()
krader1961 Sep 25, 2019
4e401a9
Switch b_read() from optget() to getopt_long()
krader1961 Sep 25, 2019
4f00fdb
Switch b_readonly() from optget() to getopt_long()
krader1961 Sep 25, 2019
8bdfa5b
Switch b_return() from optget() to getopt_long()
krader1961 Sep 25, 2019
857b058
Change naming of ksh script based tests
krader1961 Sep 25, 2019
1b34915
Fix regression involving invalid char class name
krader1961 Sep 27, 2019
2828fd9
Eliminate Meson warning about our config file
krader1961 Sep 28, 2019
07e8829
Coverity Scan lint cleanup
krader1961 Sep 29, 2019
8031fed
Remove pointless checks of malloc() failing
krader1961 Sep 29, 2019
762f838
Switch shcomp from optget() to getopt_long()
krader1961 Sep 30, 2019
ce7e096
Switch b_shift() from optget() to getopt_long()
krader1961 Sep 30, 2019
3be7e10
Switch b_sleep() from optget() to getopt_long()
krader1961 Sep 30, 2019
461707e
Switch b_sync() from optget() to getopt_long()
krader1961 Oct 1, 2019
cfec3cb
Switch b_test() from optget() to getopt_long()
krader1961 Oct 1, 2019
5c3052b
Switch b_times() from optget() to getopt_long()
krader1961 Oct 1, 2019
394ba62
Switch b_trap() from optget() to getopt_long()
krader1961 Oct 1, 2019
39bf126
Switch b_ulimit() from optget() to getopt_long()
krader1961 Oct 1, 2019
541a7d4
Switch b_umask() from optget() to getopt_long()
krader1961 Oct 2, 2019
3955a1c
Switch b_unalias() from optget() to getopt_long()
krader1961 Oct 2, 2019
485fb82
bin/style all
krader1961 Oct 2, 2019
fcd6535
Lint cleanup
krader1961 Oct 2, 2019
31aec52
Switch b_uname() from optget() to getopt_long()
krader1961 Oct 2, 2019
f8a6aa6
Switch b_unset() from optget() to getopt_long()
krader1961 Oct 2, 2019
28592fc
Switch b_wait() from optget() to getopt_long()
krader1961 Oct 3, 2019
44d6381
Switch b_wc() from optget() to getopt_long()
krader1961 Oct 3, 2019
c68faf0
Switch b_whence() from optget() to getopt_long()
krader1961 Oct 3, 2019
e02c662
Simplify nv_addtype()
krader1961 Oct 3, 2019
45ea282
Remove the `type` builtin
krader1961 Oct 3, 2019
669656b
Switch b_complete() from optget() to getopt_long()
krader1961 Oct 4, 2019
e30225b
make man
krader1961 Oct 4, 2019
7005717
Enable the expect based tests on FreeBSD
krader1961 Oct 4, 2019
2095983
Fix `complete` flag handling
krader1961 Oct 5, 2019
c3098f7
Improve handling of unit test timeouts
krader1961 Oct 6, 2019
c52d3a3
Enable real-time signal test
krader1961 Oct 7, 2019
b18d4ae
Fix meson status of skipped shcomp tests
krader1961 Oct 9, 2019
a5ecd1c
Cleanup feature test artifacts
krader1961 Oct 10, 2019
ad9d63d
Show version number through `ksh --version`
siteshwar Oct 9, 2019
f5d2e83
Update changelog with stable version number
siteshwar Oct 9, 2019
d2e31cc
Move the logic for skipping tests
krader1961 Oct 9, 2019
d1de147
Minor spelling fixes
aweeraman Oct 19, 2019
ddfe6b3
Implement an optget() like alternative
krader1961 Oct 14, 2019
7faa294
Switch from getopt_long() to optget_long()
krader1961 Oct 19, 2019
a9b86b6
Convert some getopt_long_only() to optget_long()
krader1961 Oct 19, 2019
84648ca
Convert remaining getopt_long_only()
krader1961 Oct 21, 2019
856f994
Add more optget_long() unit tests
krader1961 Oct 25, 2019
e7713a5
Try to reduce false positive expect test failures
krader1961 Oct 27, 2019
2df35bd
style --all
krader1961 Oct 28, 2019
c791a0d
Silence Coverity Scan lint warning
krader1961 Oct 28, 2019
7f5e094
Silence some bogus IWYU compiler warnings
krader1961 Oct 28, 2019
bd87dbf
Remove irrelevant assignment
krader1961 Oct 28, 2019
0d96c25
Silence lint warning about uninitialized var
krader1961 Oct 28, 2019
8e019ec
Silence lint: "Null pointer dereference"
krader1961 Oct 28, 2019
0451612
cppcheck lint elimination
krader1961 Oct 28, 2019
fec0369
silence cppcheck lint warnings
krader1961 Oct 28, 2019
a32b02c
silence cppcheck lint warnings
krader1961 Oct 28, 2019
d9103c8
Remove a couple of no longer needed cppcheck suppressions
krader1961 Oct 28, 2019
dd2c8ea
Make `DPRINTF()` more robust
krader1961 Oct 29, 2019
4a5d206
Use `static_fn` rather than `static`
krader1961 Oct 29, 2019
4503830
Update Travis "fedora" config
krader1961 Oct 29, 2019
9490d10
Correct invalid argv[-1]
krader1961 Oct 30, 2019
6511635
Silence cppcheck warning about argv[-1]
krader1961 Oct 30, 2019
651e614
Fix `cd` function and make it automatically available
krader1961 Oct 26, 2019
286203f
Run autoloaded functions through shellcheck
krader1961 Oct 30, 2019
886d86f
Fix errors due to wchar_t being two bytes
krader1961 Oct 31, 2019
f867740
Adapt unit test to new Travis Fedora env
krader1961 Oct 31, 2019
c6c8c0c
Eliminate some pointless log file content
krader1961 Nov 1, 2019
42e8a04
Eliminate command help on error if not interactive
krader1961 Nov 1, 2019
1a34ebd
lower test parallelism on travis macos
krader1961 Nov 2, 2019
2580181
enable malloc debug on travis macos
krader1961 Nov 2, 2019
b058d8c
Fix b_sync.sh test failures on some macOS systems
krader1961 Nov 2, 2019
11983a7
Fix fallback addrs2info()
danyspin97 Nov 2, 2019
8e4c8f0
Fix for test failures when home directory is not available
aweeraman Nov 3, 2019
4a438e5
Move the generated version from a .h to a .c file
krader1961 Nov 5, 2019
91b3806
Revert "Move the generated version from a .h to a .c file"
krader1961 Nov 7, 2019
a205e5a
Tweak to the -s argument and the log message to match
aweeraman Nov 3, 2019
a3c2dfb
Fix hist_nearend()
krader1961 Nov 8, 2019
c584768
Lint cleanup
krader1961 Nov 8, 2019
c25958e
Remove unused header siglist.h
krader1961 Nov 8, 2019
ffbfaf6
"unknown flag" -> "unknown option"
krader1961 Nov 8, 2019
a0c44c9
Fix ed_expand()
krader1961 Nov 10, 2019
7df11de
`functions` with not loaded autoloaded functions
krader1961 Nov 13, 2019
7c92227
Regression tests for `typeset -f` fix
krader1961 Nov 15, 2019
d72c3a6
Move the generated version from a .h to a .c file
krader1961 Nov 15, 2019
c99e9ff
Improve style of sh_close()
krader1961 Nov 15, 2019
359bf21
Add instructions for installing with MacPorts
ryandesign Nov 16, 2019
0525de9
Disable flakey API unit test
krader1961 Nov 17, 2019
42a580c
Add comment regarding the need to keep "Version A"
krader1961 Nov 20, 2019
c1af9c6
Add missing optional header
krader1961 Nov 29, 2019
61cfd45
Cleanup: remove unused function
krader1961 Nov 29, 2019
9c7211b
Improve meson warning message wording
krader1961 Nov 29, 2019
2806b21
Lint: Dangerous assignment
krader1961 Dec 1, 2019
5c16e8d
Lint cleanup
krader1961 Dec 1, 2019
ca8c7e6
Remove description of case modification operator
siteshwar Dec 9, 2019
fbaf00e
Lint: negativeIndex
krader1961 Dec 2, 2019
f05b619
Lint: invalidPointerCast
krader1961 Dec 2, 2019
82d4f30
Use the ksh semantic version in docs
krader1961 Dec 15, 2019
6928edc
Fix bug introduced by commit 6542e5a3
krader1961 Dec 5, 2019
d0a7db5
Fix shellcheck warnings created by previous commit
krader1961 Dec 15, 2019
bc901af
Enable shellcheck of standard ksh functions
krader1961 Dec 16, 2019
02525a3
Enable shellcheck on more shell scripts
krader1961 Dec 16, 2019
5efb243
Fix shellcheck errors
krader1961 Dec 16, 2019
c7de8b6
Harden env var imports
krader1961 Dec 13, 2019
c007254
Fix unit test build on NetBSD
krader1961 Dec 19, 2019
c6757a2
Fix unit test build on NetBSD
krader1961 Dec 20, 2019
b6be7e7
Harden unit test against slow test environments
krader1961 Dec 20, 2019
0d76ee4
Add option to disable */shcomp test variants
krader1961 Dec 22, 2019
2950ede
Deal with PATH being unset when running unit tests
krader1961 Dec 26, 2019
74c34dc
Move empty PATH workaround into global config
krader1961 Dec 28, 2019
d9ecc21
Fix a unit test that assumes FPATH is unset
krader1961 Dec 28, 2019
37cb9ea
Harden the test runner against a bad $PATH
krader1961 Dec 29, 2019
db20aab
Update for compatibility with macOS on TravisCI
krader1961 Dec 29, 2019
5abcbd0
Eliminate $NO_SHCOMP env var
krader1961 Dec 29, 2019
3bc5816
Fix handling of skipped directories
krader1961 Jan 9, 2020
80cc081
Avoid false positive failures of b_time.exp
krader1961 Jan 10, 2020
031d73a
Fix b_printf.sh unit test on Cygwin
krader1961 Jan 10, 2020
078cb99
Clarify how to run unit tests
krader1961 Jan 11, 2020
55cad1d
Fix potential fd leak
krader1961 Jan 12, 2020
2f9b39e
Fix b_print.sh unit test on Cygwin
krader1961 Jan 12, 2020
6b6146e
Simplify invalid locale testing
krader1961 Jan 13, 2020
b29a24d
Print correct version string on `ksh --version`
krader1961 Jan 15, 2020
b277665
Eliminate unneeded use of `getconf`
krader1961 Jan 15, 2020
2f06a34
Eliminate bogus locale tests
krader1961 Jan 15, 2020
127d2e4
Remove another `getconf LIBPATH`
krader1961 Jan 16, 2020
0641d89
Remove another bogus getconf use
krader1961 Jan 16, 2020
f80d386
Move `cd` command so `cd ~-` works
krader1961 Jan 16, 2020
d5f4cb6
Remove the remaining bogus `getconf` mention
krader1961 Jan 17, 2020
9fa5b47
Remove unused e_crondir var
krader1961 Jan 20, 2020
2986f8b
Integrate nv_optimize() bug fix from OpenSuse
krader1961 Jan 20, 2020
46d4981
Replace `0` with `NULL` to clarify intent
krader1961 Jan 20, 2020
1fd82bd
Fix interactive restricted shell behavior
krader1961 Jan 22, 2020
459a380
Eliminate pointless external getconf use
krader1961 Jan 24, 2020
3dfc236
Fix cd function and enable it in unit tests
krader1961 Nov 26, 2019
5000e7f
Rename three vars associated with cd related funcs
krader1961 Jan 26, 2020
43d1853
Suppress false-positive shellcheck warnings
krader1961 Jan 26, 2020
db54d36
Change default build type to "minsize"
krader1961 Jan 27, 2020
8cf92b2
Fix typo in the project name
krader1961 Feb 1, 2020
f8290d2
Fix compiler error on OS X 10.6
krader1961 Feb 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
19 changes: 19 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Use the Google style with these modifications and a couple of others:
#
# 1) Lines can be up to 100 chars long rather than 80.
# 2) Use a four space indent rather than two spaces.
#
Language: Cpp
BasedOnStyle: Google
ColumnLimit: 100
IndentWidth: 4

# The following directives override defaults established above.

# We don't want OCLint pragmas to be reformatted.
CommentPragmas: '^!OCLINT'

# Do not try to infer the most common alignment of `&` and `*` by analyzing the
# source file. Use right alignment; i.e., bind to the symbol not the type.
DerivePointerAlignment: false
PointerAlignment: Right
3 changes: 3 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CheckOptions:
- key: readability-braces-around-statements.ShortStatementLines
value: 1
7 changes: 7 additions & 0 deletions .copr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))

srpm:
dnf -y install git-core sed
$(current_dir)/prep.sh
rpmbuild -bs -D "dist %{nil}" -D "_sourcedir packaging/fedora" -D "_srcrpmdir $(outdir)" --nodeps packaging/fedora/ksh.spec
35 changes: 35 additions & 0 deletions .copr/prep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh -euf
set -x

# Copr sets clone depth to 500 to avoid cloning big repositories
# however we use number of commits in version number, so fetch
# full repository
# If `get fetch --unshallow` fails, this means if we have full
# repo, so ignore if it fails.
git fetch --unshallow || :

# Fetch tags to determine version number
git fetch --tags

# 2017.0.0-devel-1535-g7c33a1cd-dirty
VCS_VERSION=$(git describe --always --dirty --tags)

# Extract development version number i.e. 2017.0.0
DEVEL_VERSION_NUM=$(echo "$VCS_VERSION" | cut -d'-' -f1)

# 1535
COMMIT_NUM=$(echo "$VCS_VERSION" | cut -d'-' -f3)

# g7c33a1cd
SHORT_COMMIT=$(echo "$VCS_VERSION" | cut -d'-' -f4)

COMMIT=$(git rev-parse HEAD)

sed "s,#VCS_VERSION#,${VCS_VERSION},;
s,#DEVEL_VERSION_NUM#,${DEVEL_VERSION_NUM},;
s,#COMMIT_NUM#,${COMMIT_NUM},;
s,#SHORT_COMMIT#,${SHORT_COMMIT},;
s,#COMMIT#,${COMMIT}," \
packaging/fedora/ksh.spec.in > packaging/fedora/ksh.spec

git archive --prefix "ast-${COMMIT}/" --format "tar.gz" HEAD -o "packaging/fedora/ksh-${SHORT_COMMIT}.tar.gz"
26 changes: 26 additions & 0 deletions .cppcheck.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>

<![CDATA[
<!-- Sadly we can't enable the following two rules since doing so causes false
positives in standard header files rather than just project specific
source files. If we can find a way to enable these rules by also
excluding system include files we should do so.
<rule version="1">
<pattern> wcwidth \(</pattern>
<message>
<id>wcwidthForbidden</id>
<severity>warning</severity>
<summary>Always use fish_wcwidth rather than wcwidth.</summary>
</message>
</rule>

<rule version="1">
<pattern> wcswidth \(</pattern>
<message>
<id>wcswidthForbidden</id>
<severity>warning</severity>
<summary>Always use fish_wcswidth rather than wcswidth.</summary>
</message>
</rule>
<--!>
]]>
26 changes: 26 additions & 0 deletions .cppcheck.suppressions
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// suppress all instances of varFuncNullUB: "Passing NULL after the last typed
// argument to a variadic function leads to undefined behaviour." That's
// because all the places we do this are valid and won't cause problems even
// on a ILP64 platform because we're careful about using NULL rather than 0.
varFuncNullUB
// Suppress the warning about unmatched suppressions. At the moment these
// warnings are emitted even when removing the suppression comment results in
// the warning being suppressed. In other words this unmatchedSuppression
// warnings are false positives.
unmatchedSuppression
// There is currently one function which triggers this warning multiple times:
// src/cmd/ksh93/sh/io.c. Those warnings are all false positives. Suppressing
// them with inline warnings is too hideous to allow so globally suppress them.
resourceLeak
// For the moment we ignore warnings about using non-reentrant functions when
// a reentrant thread-safe variant exists. Since ksh is single-threaded this
// isn't a problem although it could be is a third-party plugin created
// threads that used any of these functions.
getpwuidCalled
ttynameCalled
getloginCalled
getpwnamCalled
// The fallbacks.c module is likely to need cppcheck suppressions. But due to
// how they are parsed, independent of any enclosing `#if` directives, they are
// also likely to cause warnings like "Unmatched suppression: mktempCalled".
unmatchedSuppression:../src/lib/libast/misc/fallbacks.c
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
indent_size = 4
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100

[{Makefile,*.in}]
indent_style = tab
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Template for bug reports
---

**Description of problem:**


**Ksh version:**


**How reproducible:**


**Steps to reproduce:**
1.
2.
3.

**Actual results:**


**Expected results:**


**Additional info:**
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# There are some patterns below we include reluctantly. They should be in an
# individual's ~/.config/git/ignore file. For example, ".DS_Store" for people
# working on MacOS. We include them to help ensure they arent't added to the
# project.

# Files and file extensions that should never be checked in regardless of
# which project directory they reside in.
*.exe
*.app
*.so
*.dylib
*.dll
*.lai
*.la
*.a
*.lib
*.o
*.obj
*.lo
*.slo
*.d
*.gch
*.pch
*.bak
*.new
*.orig
*.log
*.DS_Store
*~
*~HEAD
.AppleDouble
.LSOverride
.Trash-*
._*
Desktop.ini

# Artifacts of the build, install, and test process that should not be committed.
build/
130 changes: 130 additions & 0 deletions .oclint
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
rules:
rule-configurations:
# This is the default value (as of the time I wrote this) but I'm making
# it explicit since it needs to agree with the value used by clang-format.
# Thus, if we ever change the style guide to allow longer or shorter lines
# this should be changed (as well as the corresponding .clang-format file).
- key: LONG_LINE
value: 100

# The default limit for the length of variable names is 20. Long names are
# problematic but twenty chars results in way too many errors. So increase
# the limit to something more reasonable.
- key: LONG_VARIABLE_NAME
value: 30

# TODO: Return this to a saner value such as 60 (or even 100) once the
# truly obscene functions have been refactored.
#
# We're slightly more persmissive regarding the total number of lines in a
# function. Default is 50.
- key: LONG_METHOD
value: 500

# TODO: Return this to the default of 5 once the more egregious nested
# blocks have been eliminated.
#
# We're slightly more persmissive regarding the nested block depth.
# Default is 5.
- key: NESTED_BLOCK_DEPTH
value: 7

# We're slightly more persmissive regarding the number of non-comment
# lines in a function. Default is 30.
- key: NCSS_METHOD
value: 40

# We're willing to allow slighly more linearly independent paths through a
# function. Most of our code has a lot of `switch` blocks or consecutive
# `if` tests that are straightforward to interpret but which increase this
# metric. Default is 10.
- key: CYCLOMATIC_COMPLEXITY
value: 14

# We're willing to allow slighly more execution paths through a function.
# Default is 200.
- key: NPATH_COMPLEXITY
value: 300

disable-rules:
#
# A few instances of "useless parentheses" errors are meaningful. Mostly
# in the context of the `return` statement. Unfortunately the vast
# majority would result in removing parentheses that decreases
# readability. So we're going to ignore this warning and rely on humans to
# notice when the parentheses are truly not needed.
#
# Also, some macro expansions, such as FD_SET(), trigger this warning and
# we don't want to suppress each of those individually.
#
- UselessParentheses
#
# OCLint wants variable names to be at least three characters in length.
# Which would be fine if it supported a reasonable set of exceptions
# (e.g., "i", "j", "k") and allowed adding additional exceptions to match
# conventions employed by a project. Since it doesn't, and thus generates
# a lot of really annoying warnings, we're going to disable this rule.
#
- ShortVariableName
#
# This rule flags perfectly reasonable conditions like `if (!some_condition)`
# and is therefore just noise. Disable this rule.
#
- InvertedLogic
#
# The idea behind the "double negative" rule is sound since constructs
# like "!!(var & flag)" should be written as "static_cast<bool>(var &
# flag)". Unfortunately this rule has way too many false positives;
# especially in the context of assert statements. So disable this rule.
#
- DoubleNegative
#
# Avoiding bitwise operators in a conditional is a good idea with one
# exception: testing whether a bit flag is set. Which happens to be the
# only time you'll see something like `if (j->flags & JOB_CONSTRUCTED)`
# in project source.
#
- BitwiseOperatorInConditional
#
# I don't think I've ever seen a case where assigning a value to a
# parameter inside the function body was unclear, let along dangerour or
# an error. This rule is therefore just noise. Disable this rule.
#
- ParameterReassignment
#
# The project makes so much use of the `goto` statement, many of which
# will require significant refactoring to remove, that warnings about its
# use are just noise.
#
- GotoStatement
#
# Oclint has too many false positives regarding missing `break;`
# statements. Mostly having to do with `case` blocks that use `goto` to
# exit the block. In some cases because it doesn't recognize
# `__builtin_unreachable()` to flag that the previous statement won't
# return. And the compiler already alerts us to case blocks that fall
# through to the next case block.
- MissingBreakInSwitchStatement
#
# This warning is perfectly reasonable for most projects but not for ksh.
# There are simply too many `switch` blocks with as little as two branches
# but which we cannot justify rewriting.
# TODO: Enable this warning in the future.
#
- TooFewBranchesInSwitchStatement
#
# The structure of the code means that it is often clearer to nest `if()`
# statements even though they could be written as a single `if()`. I've
# simplified all the instances where no clarity is lost by combining them.
# Those instances that remain would be made harder to read and reason
# about if they were combined. Eliminating these instances requires
# refactoring that is hard to justify. So disable this warning.
- CollapsibleIfStatements
#
# TODO: Enable These in the future after simpler or more serious issues
# have been addressed. At this time these warnings just make it hard to
# see the issues that are easier or more urgent to resolve. So disable them.
#
- HighCyclomaticComplexity
- HighNPathComplexity
- HighNcssMethod
Loading