mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
string-helpers.c: add string_empty()
This commit is contained in:
parent
8c9be2f0d1
commit
c066821046
9 changed files with 27 additions and 14 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#include "buffer.h"
|
||||
#include "button/button-png.h"
|
||||
#include "button/common.h"
|
||||
#include "common/string-helpers.h"
|
||||
#include "labwc.h"
|
||||
|
||||
/*
|
||||
|
|
@ -49,7 +50,7 @@ button_png_load(const char *button_name, struct lab_data_buffer **buffer)
|
|||
wlr_buffer_drop(&(*buffer)->base);
|
||||
*buffer = NULL;
|
||||
}
|
||||
if (!button_name || !*button_name) {
|
||||
if (string_null_or_empty(button_name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include "buffer.h"
|
||||
#include "button/button-svg.h"
|
||||
#include "button/common.h"
|
||||
#include "common/string-helpers.h"
|
||||
#include "labwc.h"
|
||||
|
||||
void
|
||||
|
|
@ -22,7 +23,7 @@ button_svg_load(const char *button_name, struct lab_data_buffer **buffer,
|
|||
wlr_buffer_drop(&(*buffer)->base);
|
||||
*buffer = NULL;
|
||||
}
|
||||
if (!button_name || !*button_name) {
|
||||
if (string_null_or_empty(button_name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include "button/common.h"
|
||||
#include "common/grab-file.h"
|
||||
#include "common/mem.h"
|
||||
#include "common/string-helpers.h"
|
||||
#include "buffer.h"
|
||||
|
||||
enum token_type {
|
||||
|
|
@ -279,7 +280,7 @@ button_xbm_load(const char *button_name, struct lab_data_buffer **buffer,
|
|||
wlr_buffer_drop(&(*buffer)->base);
|
||||
*buffer = NULL;
|
||||
}
|
||||
if (!button_name || !*button_name) {
|
||||
if (string_null_or_empty(button_name)) {
|
||||
return;
|
||||
}
|
||||
color = argb32(rgba);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue