mirror of
https://github.com/Alcaro/Flips.git
synced 2026-09-07 10:06:09 -05:00
Allow removing things from this config. Still a ridiculously inefficient solution, of course.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//Module name: Floating IPS, GTK+ frontend
|
||||
//Author: Alcaro
|
||||
//Date: See Git timestamps
|
||||
//Date: See Git history
|
||||
//Licence: GPL v3.0 or higher
|
||||
|
||||
//List of assumptions made whose correctness is not guaranteed by GTK+:
|
||||
|
||||
@@ -251,7 +251,7 @@ void config::set(LPCWSTR name, LPCWSTR value)
|
||||
if (!wcscmp(name, this->names[i]))
|
||||
{
|
||||
free(this->values[i]);
|
||||
this->values[i] = wcsdup(value);
|
||||
this->values[i] = (value!=NULL ? wcsdup(value) : NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -292,7 +292,10 @@ LPWSTR config::flatten()
|
||||
at += wsprintf(at, "%s", header);
|
||||
for (size_t i=0;i<this->numentries;i++)
|
||||
{
|
||||
at += wsprintf(at, "%s=%s\n", this->names[i], this->values[i]);
|
||||
if (this->values[i]!=NULL)
|
||||
{
|
||||
at += wsprintf(at, "%s=%s\n", this->names[i], this->values[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
8
flips.h
8
flips.h
@@ -1,6 +1,6 @@
|
||||
//Module name: Floating IPS, header for all frontends
|
||||
//Author: Alcaro
|
||||
//Date: June 18, 2015
|
||||
//Date: See Git history
|
||||
//Licence: GPL v3.0 or higher
|
||||
|
||||
//Preprocessor switch documentation:
|
||||
@@ -69,9 +69,9 @@
|
||||
#include <ctype.h>
|
||||
|
||||
//Flips uses Windows type names internally, since it's easier to #define them to Linux types than
|
||||
//defining "const char *" to anything else. Inventing my own typedefs seems counterproductive as
|
||||
//well; they would bring no advantage over Windows typenames except not being Windows typenames, and
|
||||
//I don't see that as a valid argument.
|
||||
//defining "const char *" to anything else. I could invent my own typedefs, but the only advantage
|
||||
//that would bring over Windows types would be not being Windows types, and I don't see that as a
|
||||
//valid argument.
|
||||
|
||||
#define LPCWSTR const char *
|
||||
#define LPWSTR char *
|
||||
|
||||
Reference in New Issue
Block a user