Import sources from 2011-03-30 iso image
This commit is contained in:
commit
e5888a1ffd
7810 changed files with 2489717 additions and 0 deletions
23
sys/src/libString/s_reset.c
Executable file
23
sys/src/libString/s_reset.c
Executable file
|
@ -0,0 +1,23 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include "String.h"
|
||||
|
||||
String*
|
||||
s_reset(String *s)
|
||||
{
|
||||
if(s != nil){
|
||||
s = s_unique(s);
|
||||
s->ptr = s->base;
|
||||
*s->ptr = '\0';
|
||||
} else
|
||||
s = s_new();
|
||||
return s;
|
||||
}
|
||||
|
||||
String*
|
||||
s_restart(String *s)
|
||||
{
|
||||
s = s_unique(s);
|
||||
s->ptr = s->base;
|
||||
return s;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue