History

libc: update encodefmt support l flag on < (base32) (from 9front)

cinap_lenrek committed 8 years ago

Commit 0fbac081 parent 07eda1b1 file · +7 −6Browse files

Unified · Split

libc/encodefmt.c+7−6
@@ -48,17 +48,14 @@ encodefmt(Fmt *f) · 47 unmodified lines
48 // convert48 // convert
49 out = buf;49 out = buf;
50 switch(f->r){50 switch(f->r){
51 case '<':
52 rv = enc32(out, len, b, ilen);
53 break;
54 case '[':51 case '[':
55 rv = enc64(out, len, b, ilen);52 rv = enc64(out, len, b, ilen);
56 break;53 break;
54 case '<':
55 rv = enc32(out, len, b, ilen);
56 break;
57 case 'H':57 case 'H':
58 rv = enc16(out, len, b, ilen);58 rv = enc16(out, len, b, ilen);
59 if(rv >= 0 && (f->flags & FmtLong))
60 for(p = buf; *p; p++)
61 *p = tolower(*p);
62 break;59 break;
63 default:60 default:
64 rv = -1;61 rv = -1;
@@ -67,6 +64,10 @@ encodefmt(Fmt *f) · 2 unmodified lines
67 if(rv < 0)64 if(rv < 0)
68 goto error;65 goto error;
69 66
67 if((f->flags & FmtLong) != 0 && f->r != '[')
68 for(p = buf; *p; p++)
69 *p = tolower(*p);
70
70 fmtstrcpy(f, buf);71 fmtstrcpy(f, buf);
71 if(buf != obuf)72 if(buf != obuf)
72 free(buf);73 free(buf);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t