From f6e3b2f8a59922405f42c8bc283e0f5546c25d0e Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Thu, 11 Oct 2007 22:36:28 +0800 Subject: [ARITH] Add assignment and intmax_t support This patch adds assignment operator support in arithmetic expansions. It also changes the type used to intmax_t. --- src/mystring.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mystring.c') diff --git a/src/mystring.c b/src/mystring.c index df1691b..b84b7e2 100644 --- a/src/mystring.c +++ b/src/mystring.c @@ -112,13 +112,13 @@ prefix(const char *string, const char *pfx) /* * Convert a string into an integer of type intmax_t. Alow trailing spaces. */ -intmax_t atomax10(const char *s) +intmax_t atomax(const char *s, int base) { char *p; intmax_t r; errno = 0; - r = strtoimax(s, &p, 10); + r = strtoimax(s, &p, base); if (errno != 0) sh_error(illnum, s); @@ -132,6 +132,11 @@ intmax_t atomax10(const char *s) return r; } +intmax_t atomax10(const char *s) +{ + return atomax(s, 10); +} + /* * Convert a string of digits to an integer, printing an error message on * failure. -- cgit 1.4.1 commit diff
path: root/.bin (unfollow)
Commit message (Expand)Author
2017-06-07Add iTerm light profile and disable hotkeyJune McEnroe
2017-06-07Remap C-w {n,e} in vim for Tarmak 1June McEnroe
2017-06-06Rebind hnel in vim for Tarmak 1June McEnroe
2017-06-06Use C-space as tmux prefixJune McEnroe
2017-06-06Add Tarmak layoutsJune McEnroe
2017-05-26Rename keyboard layout ProgrammingJune McEnroe
2017-05-25Fix Library install conditionJune McEnroe
2017-05-25Revert "Remove macOS keyboard layout"June McEnroe
2017-05-08Fix copy mode bindings for tmux 2.4June McEnroe
2017-05-02Remove option unnecessary in nvim 0.2June McEnroe
2017-05-01Reorder lines in psqlrcJune McEnroe
2017-05-01Clean up Karabiner configurationJune McEnroe
2017-05-01Fix prune script loopJune McEnroe
2017-05-01Fix prune scriptJune McEnroe
2017-05-01Clean up SSH configJune McEnroe
2017-05-01Rename colorscheme "trivial"June McEnroe
2017-05-01Update vendored pathogenJune McEnroe
2017-05-01Clean up git configJune McEnroe
2017-05-01Clean up style in xxJune McEnroe
2017-05-01Clean up style in pbdJune McEnroe
2017-05-01Use EX_OK in pbcopyJune McEnroe
2017-04-30Clean up clockJune McEnroe
2017-04-30Clean up error strings in briJune McEnroe
2017-03-18Add -u option to xxJune McEnroe
2017-03-15Fix non-string-literal-format-string in briJune McEnroe
2017-03-15Fix bri compilationJune McEnroe
2017-03-15Use psvar for title settingJune McEnroe
2017-03-14Add bri brightness control scriptJune McEnroe
2017-03-14Add comment to tmux terminal overrideJune McEnroe
2017-03-13Have tmux set block cursor on linux consoleJune McEnroe
2017-03-13Use inverse for Visual in colorschemeJune McEnroe