Correctly handle zfs pools

#413
This commit is contained in:
Linus Dierheimer
2023-02-01 15:56:25 +01:00
parent 619ec921ee
commit a063cd4feb
22 changed files with 74 additions and 19 deletions
-11
View File
@@ -3,17 +3,6 @@
#include <ctype.h>
#include <inttypes.h>
bool ffStrSet(const char* str)
{
if(str == NULL)
return false;
while(isspace(*str))
str++;
return *str != '\0';
}
static char* CHAR_NULL_PTR = "";
void ffStrbufInitA(FFstrbuf* strbuf, uint32_t allocate)
-2
View File
@@ -18,8 +18,6 @@
#define strcasestr StrStrIA
#endif
bool ffStrSet(const char* str);
#define FASTFETCH_STRBUF_DEFAULT_ALLOC 32
typedef struct FFstrbuf
+1
View File
@@ -1,4 +1,5 @@
#include "FFPlatform_private.h"
#include "util/stringUtils.h"
void ffPlatformInit(FFPlatform* platform)
{
+1 -1
View File
@@ -1,5 +1,5 @@
#include "FFPlatform_private.h"
#include "util/stringUtils.h"
#include "fastfetch_config.h"
#include <unistd.h>
+29
View File
@@ -0,0 +1,29 @@
#include "stringUtils.h"
#include <string.h>
#include <ctype.h>
bool ffStrSet(const char* str)
{
if(str == NULL)
return false;
while(isspace(*str))
str++;
return *str != '\0';
}
bool ffStrHasNChars(const char* str, char c, uint32_t n)
{
for(uint32_t i = 0; i < n; i++)
{
char* current = strchr(str, c);
if(current == NULL)
return false;
str = current + 1;
}
return true;
}
+12
View File
@@ -0,0 +1,12 @@
#pragma once
#ifndef FF_INCLUDED_util_stringUtils_h
#define FF_INCLUDED_util_stringUtils_h
#include <stdbool.h>
#include <stdint.h>
bool ffStrSet(const char* str);
bool ffStrHasNChars(const char* str, char c, uint32_t n);
#endif