| author | |
| committer | |
| log | bd487677bda80ecd701a7ab8ce9a2347bfbf5995 |
| tree | d0b9bd648bb1490db33b3886457c5212ed0c8f3c |
| parent | a74468be60283e66e9b20388372394b54219d6b0 |
1 files changed, 6 insertions(+), 0 deletions(-)
src/lib.zig+6| ... | ... | @@ -457,3 +457,9 @@ pub fn readFile(dir: std.fs.Dir, sub_path: string, alloc: std.mem.Allocator) !st |
| 457 | 457 | pipe(file.reader(), buffer.writer()) catch @panic("unreachable"); // did the filesystem lie? |
| 458 | 458 | return buffer.items; |
| 459 | 459 | } |
| 460 | ||
| 461 | pub fn nullifyS(s: ?string) ?string { | |
| 462 | if (s == null) return null; | |
| 463 | if (s.?.len == 0) return null; | |
| 464 | return s.?; | |
| 465 | } |