mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-15 11:20:03 +00:00
17 lines
173 B
C
17 lines
173 B
C
|
#include <u.h>
|
||
|
#include <libc.h>
|
||
|
#include "libString.h"
|
||
|
|
||
|
String*
|
||
|
s_unique(String *s)
|
||
|
{
|
||
|
String *p;
|
||
|
|
||
|
if(s->ref > 1){
|
||
|
p = s;
|
||
|
s = s_clone(p);
|
||
|
s_free(p);
|
||
|
}
|
||
|
return s;
|
||
|
}
|