diff options
author | rsc <devnull@localhost> | 2004-12-26 23:17:03 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-12-26 23:17:03 +0000 |
commit | a3add39bbc986fe21e3450553259e8f5e1fb22d0 (patch) | |
tree | 2ee385be960a0978d46d31ba84eb210dfce92e02 /src | |
parent | 00975b7ef17ceca677c80e98a7fe71bdca8ff17c (diff) | |
download | plan9port-a3add39bbc986fe21e3450553259e8f5e1fb22d0.tar.gz plan9port-a3add39bbc986fe21e3450553259e8f5e1fb22d0.tar.bz2 plan9port-a3add39bbc986fe21e3450553259e8f5e1fb22d0.zip |
plan 9 changes
Diffstat (limited to 'src')
-rw-r--r-- | src/lib9/encodefmt.c | 7 | ||||
-rw-r--r-- | src/lib9/mkfile | 2 | ||||
-rw-r--r-- | src/lib9/portdate | 55 |
3 files changed, 62 insertions, 2 deletions
diff --git a/src/lib9/encodefmt.c b/src/lib9/encodefmt.c index 5dd2f488..27878167 100644 --- a/src/lib9/encodefmt.c +++ b/src/lib9/encodefmt.c @@ -11,10 +11,12 @@ encodefmt(Fmt *f) uchar *b; char obuf[64]; // rsc optimization - if(!(f->flags&FmtPrec) || f->prec < 0) + if(!(f->flags&FmtPrec) || f->prec < 1) goto error; b = va_arg(f->args, uchar*); + if(b == 0) + return fmtstrcpy(f, "<nil>"); ilen = f->prec; f->prec = 0; @@ -51,6 +53,9 @@ encodefmt(Fmt *f) break; case 'H': rv = enc16(out, len, b, ilen); + if(rv >= 0 && (f->flags & FmtLong)) + for(p = buf; *p; p++) + *p = tolower(*p); break; default: rv = -1; diff --git a/src/lib9/mkfile b/src/lib9/mkfile index 0c1c3027..88fcf6fe 100644 --- a/src/lib9/mkfile +++ b/src/lib9/mkfile @@ -13,7 +13,7 @@ FMTOFILES=\ fmt.$O\ fmtfd.$O\ fmtfdflush.$O\ - fmtlock.$O\ + fmtlock2.$O\ fmtprint.$O\ fmtquote.$O\ fmtrune.$O\ diff --git a/src/lib9/portdate b/src/lib9/portdate new file mode 100644 index 00000000..a9fb5197 --- /dev/null +++ b/src/lib9/portdate @@ -0,0 +1,55 @@ +announce.c 2004/1225 +atexit.c 2004/1225 +atnotify.c 2004/1225 +atol.c 2004/1225 +atoll.c 2004/1225 +cistrcmp.c 2004/1225 +cistrncmp.c 2004/1225 +cistrstr.c 2004/1225 +cleanname.c 2004/1225 +convD2M.c 2004/1225 +convM2D.c 2004/1225 +convM2S.c 2004/1225 +convS2M.c 2004/1225 +ctime.c 2004/1225 +dial.c 2004/1225 +dirfstat.c 2004/1225 +dirfwstat.c 2004/1225 +dirmodefmt.c 2004/1225 +dirread.c 2004/1225 +dirstat.c 2004/1225 +dirwstat.c 2004/1225 +encodefmt.c 2004/1225 +fcallfmt.c 2004/1225 +fork.c 2004/1225 +getenv.c 2004/1225 +getfields.c 2004/1225 +getuser.c 2004/1225 +getwd.c 2004/1225 +lnrand.c 2004/1225 +lock.c 2004/1225 +lrand.c 2004/1225 +malloc.c 2004/1225 +nan.c 2004/1225 +needsrcquote.c 2004/1225 +netmkaddr.c 2004/1225 +nrand.c 2004/1225 +nulldir.c 2004/1225 +postnote.c 2004/1225 +qlock.c 2004/1225 +quote.c 2004/1225 +rand.c 2004/1225 +read9pmsg.c 2004/1225 +readn.c 2004/1225 +strdup.c 2004/1225 +strecpy.c 2004/1225 +sysfatal.c 2004/1225 +sysname.c 2004/1225 +time.c 2004/1225 +tokenize.c 2004/1225 +truerand.c 2004/1225 +u16.c 2004/1225 +u32.c 2004/1225 +u64.c 2004/1225 +wait.c 2004/1225 +waitpid.c 2004/1225 |