]> git.sur5r.net Git - i3/i3/blobdiff - libi3/format_placeholders.c
Merge branch 'release-4.16.1'
[i3/i3] / libi3 / format_placeholders.c
index c9cbbea446274567c09e8c62927ef390884d6c8a..770e383d7af7640fbbb679928119ca07d89f64d6 100644 (file)
@@ -5,14 +5,14 @@
  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
+#include "libi3.h"
+
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
 
-#include "libi3.h"
-
-#ifndef STARTS_WITH
-#define STARTS_WITH(string, needle) (strncasecmp((string), (needle), strlen((needle))) == 0)
+#ifndef CS_STARTS_WITH
+#define CS_STARTS_WITH(string, needle) (strncmp((string), (needle), strlen((needle))) == 0)
 #endif
 
 /*
@@ -28,7 +28,7 @@ char *format_placeholders(char *format, placeholder_t *placeholders, int num) {
     int buffer_len = strlen(format) + 1;
     for (char *walk = format; *walk != '\0'; walk++) {
         for (int i = 0; i < num; i++) {
-            if (!STARTS_WITH(walk, placeholders[i].name))
+            if (!CS_STARTS_WITH(walk, placeholders[i].name))
                 continue;
 
             buffer_len = buffer_len - strlen(placeholders[i].name) + strlen(placeholders[i].value);
@@ -48,7 +48,7 @@ char *format_placeholders(char *format, placeholder_t *placeholders, int num) {
 
         bool matched = false;
         for (int i = 0; i < num; i++) {
-            if (!STARTS_WITH(walk, placeholders[i].name)) {
+            if (!CS_STARTS_WITH(walk, placeholders[i].name)) {
                 continue;
             }