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

Added printf builtin in fish #611

Merged
merged 15 commits into from Mar 22, 2013

Conversation

Projects
None yet
2 participants
@siteshwar
Member

siteshwar commented Mar 6, 2013

No description provided.

Show outdated Hide outdated builtin_printf.cpp
#define isodigit(c) ((c) >= L'0' && (c) <= L'7')
#define hextobin(c) ((c) >= L'a' && (c) <= L'f' ? (c) - L'a' + 10 : \
(c) >= L'A' && (c) <= L'F' ? (c) - L'A' + 10 : (c) - L'0')
#define octtobin(c) ((c) - L'0')

This comment has been minimized.

@siteshwar

siteshwar Mar 6, 2013

Member

I am not sure if it's a portable way to convet wide characters to numbers.

@siteshwar

siteshwar Mar 6, 2013

Member

I am not sure if it's a portable way to convet wide characters to numbers.

case L'b': /* Backspace. */
append_format(stdout_buffer, L"%lc", L'\b');
break;
case L'c': /* Cancel the rest of the output. */

This comment has been minimized.

@siteshwar

siteshwar Mar 6, 2013

Member

This calls exit(0) in GNU coreutils version of printf, but I can't directly exit in a builtin.

@siteshwar

siteshwar Mar 6, 2013

Member

This calls exit(0) in GNU coreutils version of printf, but I can't directly exit in a builtin.

@siteshwar

This comment has been minimized.

Show comment
Hide comment
@siteshwar

siteshwar Mar 15, 2013

Member

Link to version of GNU Coreutils from which I imported printf http://ftp.gnu.org/gnu/coreutils/coreutils-6.9.tar.bz2

Check src/printf.c

Member

siteshwar commented Mar 15, 2013

Link to version of GNU Coreutils from which I imported printf http://ftp.gnu.org/gnu/coreutils/coreutils-6.9.tar.bz2

Check src/printf.c

@ridiculousfish ridiculousfish merged commit 5dbda6c into fish-shell:master Mar 22, 2013

@ridiculousfish

This comment has been minimized.

Show comment
Hide comment
@ridiculousfish

ridiculousfish Mar 22, 2013

Member

To git@github.com:fish-shell/fish-shell.git
7e96527..1d93e89 master -> master

Thanks! Wonderful!

Member

ridiculousfish commented Mar 22, 2013

To git@github.com:fish-shell/fish-shell.git
7e96527..1d93e89 master -> master

Thanks! Wonderful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment