diff options
author | Björn Gustavsson <[email protected]> | 2013-02-14 12:04:56 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-02-14 12:04:56 +0100 |
commit | 9905024a8b7d9a26f7fdf6640ab391c5cb8f6780 (patch) | |
tree | 435f9e18d02c565efa184b56956dfa4db35a173a /lib/stdlib/src/c.erl | |
parent | 3a223f53c7c4fa5d2656c8cdc5dae74f20185b04 (diff) | |
parent | 1d6ac47dc148bcfdb61c205b709b61172374eb30 (diff) | |
download | otp-9905024a8b7d9a26f7fdf6640ab391c5cb8f6780.tar.gz otp-9905024a8b7d9a26f7fdf6640ab391c5cb8f6780.tar.bz2 otp-9905024a8b7d9a26f7fdf6640ab391c5cb8f6780.zip |
Merge branch 'bjorn/stdlib/types'
* bjorn/stdlib/types:
Make the file:filename() type more restrictive
c: Remove handling of binaries in return from file:list_dir/1
Diffstat (limited to 'lib/stdlib/src/c.erl')
-rw-r--r-- | lib/stdlib/src/c.erl | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/stdlib/src/c.erl b/lib/stdlib/src/c.erl index 535f2d5174..e31ae6b9ef 100644 --- a/lib/stdlib/src/c.erl +++ b/lib/stdlib/src/c.erl @@ -685,7 +685,7 @@ portformat(Name, Id, Cmd) -> pwd() -> case file:get_cwd() of {ok, Str} -> - ok = io:format("~ts\n", [fixup_one_bin(Str)]); + ok = io:format("~ts\n", [Str]); {error, _} -> ok = io:format("Cannot determine current directory\n") end. @@ -712,27 +712,11 @@ ls() -> ls(Dir) -> case file:list_dir(Dir) of {ok, Entries} -> - ls_print(sort(fixup_bin(Entries))); + ls_print(sort(Entries)); {error,_E} -> format("Invalid directory\n") end. -fixup_one_bin(X) when is_binary(X) -> - L = binary_to_list(X), - [ if - El > 127 -> - $?; - true -> - El - end || El <- L]; -fixup_one_bin(X) -> - X. -fixup_bin([H|T]) -> - [fixup_one_bin(H) | fixup_bin(T)]; -fixup_bin([]) -> - []. - - ls_print([]) -> ok; ls_print(L) -> Width = min([max(lengths(L, [])), 40]) + 5, |