~rdoering/ubuntu/intrepid/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/kernel/src/group.erl

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2007-05-01 16:57:10 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070501165710-2sapk0hp2gf3o0ip
Tags: 1:11.b.4-2ubuntu1
* Merge with Debian Unstable. Remaining changes:
  - Add -fno-stack-protector to fix broken crypto_drv.
* DebianMaintainerField update.

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
setopts(Opts0,_Drv, Buf) ->
225
225
    Opts = proplists:substitute_negations([{list,binary}], Opts0),
226
226
    put(expand_fun, proplists:get_value(expand_fun, Opts, get(expand_fun))),
227
 
    case proplists:get_value(binary, Opts) of
 
227
    case proplists:get_bool(binary, Opts) of
228
228
        true ->
229
 
            put(read_mode,binary),
 
229
            put(read_mode, binary),
230
230
            {ok,ok,Buf};
231
231
        false ->
232
 
            put(read_mode,list),
233
 
            {ok,ok,Buf};
234
 
        _ ->
235
 
            {error,{error,badarg},Buf}
 
232
            put(read_mode, list),
 
233
            {ok,ok,Buf}
236
234
    end.
237
235
 
238
236
%% get_chars(Prompt, Module, Function, XtraArgument, Drv, Buffer)
350
348
                  [$\^L | Cs1]
351
349
         end,
352
350
    get_line1(edlin:edit_line(Cs, Cont), Drv, Ls0);
353
 
    
354
 
%%     Rs = expand(
355
 
%%     case down_stack(Ls0) of
356
 
%%      {none,_Ls} ->
357
 
%%          send_drv_reqs(Drv, edlin:erase_line(Cont)),
358
 
%%          get_line1(edlin:start(edlin:prompt(Cont)), Drv, Ls0);
359
 
%%      {Lcs,Ls} ->
360
 
%%          send_drv_reqs(Drv, edlin:erase_line(Cont)),
361
 
%%          {more_chars,Ncont,Nrs} = edlin:start(edlin:prompt(Cont)),
362
 
%%          send_drv_reqs(Drv, Nrs),
363
 
%%          get_line1(edlin:edit_line1(lists:sublist(Lcs, 1, length(Lcs)-1),
364
 
%%                                    Ncont),
365
 
%%                    Drv,
366
 
%%                    Ls)
367
 
%%     end;
368
351
get_line1({undefined,_Char,Cs,Cont,Rs}, Drv, Ls) ->
369
352
    send_drv_reqs(Drv, Rs),
370
353
    send_drv(Drv, beep),
468
451
prompt_bytes(Prompt) ->
469
452
    lists:flatten(io_lib:format("~p", [Prompt])).
470
453
 
471
 
cast(L, binary) when list(L) ->
 
454
cast(L, binary) when is_list(L) ->
472
455
    list_to_binary(L);
473
 
cast(B, list) when binary(B) ->
474
 
    binary_to_list(B);
475
 
cast(Eof, _undefined) ->
476
 
    Eof.
 
456
cast(Other, _) ->
 
457
    Other.
477
458
 
478
 
append(B, L) when binary(B) ->
 
459
append(B, L) when is_binary(B) ->
479
460
    binary_to_list(B)++L;
480
 
append(L1, L2) when list(L1) ->
 
461
append(L1, L2) when is_list(L1) ->
481
462
    L1++L2;
482
463
append(_Eof, L) ->
483
464
    L.