Add my patch for fixing includes

ledoian
LEdoian 5 months ago
parent 44b72315cd
commit 91e2bf0efa

@ -52,12 +52,15 @@ optdepends=(
source=("https://github.com/swaywm/sway/releases/download/$pkgver/sway-$pkgver.tar.gz"
"https://github.com/swaywm/sway/releases/download/$pkgver/sway-$pkgver.tar.gz.sig"
"50-systemd-user.conf"
"sway-portals.conf")
"sway-portals.conf"
"fix-includes.patch"
)
install=sway.install
sha512sums=('1d2a47bb8b838573a32f3719a7329fd744119c2c7efc5e5a4168b2bacfb09a3901a569177e5e10c129141fafe00e823ab78c04b76b502d23caa7621bbccd5919'
'SKIP'
'd5f9aadbb4bbef067c31d4c8c14dad220eb6f3e559e9157e20e1e3d47faf2f77b9a15e52519c3ffc53dc8a5202cb28757b81a4b3b0cc5dd50a4ddc49e03fe06e'
'4f9576b7218aef8152eb60e646985e96b13540b7a4fd34ba68fdc490199cf7a7b46bbee85587e41bffe81fc730222cf408d5712e6251edc85a0a0b0408c1a2df')
'4f9576b7218aef8152eb60e646985e96b13540b7a4fd34ba68fdc490199cf7a7b46bbee85587e41bffe81fc730222cf408d5712e6251edc85a0a0b0408c1a2df'
'9ed8957779922cdc99869ea9ce34821c1eb1cac20e3a8cc52369fbbf3237f6a8e754ccdd445f48624c23d7bf599538083405cec599787addc423e47d28dcf6ca')
validpgpkeys=('34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48' # Simon Ser
'9DDA3B9FA5D58DD5392C78E652CB6609B22DA89A') # Drew DeVault
@ -65,6 +68,7 @@ prepare() {
cd "$pkgname-$pkgver"
# Set the version information to 'Arch Linux' instead of 'makepkg'
sed -i "s/branch \\\'@1@\\\'/Arch Linux/g" meson.build
patch -p1 < ../fix-includes.patch
}
build() {

@ -0,0 +1,45 @@
diff --git a/sway/config.c b/sway/config.c
index f9131e0f..a7784f13 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -593,28 +593,12 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
return success;
}
-static bool load_include_config(const char *path, const char *parent_dir,
- struct sway_config *config, struct swaynag_instance *swaynag) {
+static bool load_include_config(const char *path, struct sway_config *config,
+ struct swaynag_instance *swaynag) {
// save parent config
const char *parent_config = config->current_config_path;
- char *full_path;
- int len = strlen(path);
- if (len >= 1 && path[0] != '/') {
- len = len + strlen(parent_dir) + 2;
- full_path = malloc(len * sizeof(char));
- if (!full_path) {
- sway_log(SWAY_ERROR,
- "Unable to allocate full path to included config");
- return false;
- }
- snprintf(full_path, len, "%s/%s", parent_dir, path);
- } else {
- full_path = strdup(path);
- }
-
- char *real_path = realpath(full_path, NULL);
- free(full_path);
+ char *real_path = realpath(path, NULL);
if (real_path == NULL) {
sway_log(SWAY_DEBUG, "%s not found.", path);
@@ -666,7 +650,7 @@ void load_include_configs(const char *path, struct sway_config *config,
char **w = p.we_wordv;
size_t i;
for (i = 0; i < p.we_wordc; ++i) {
- load_include_config(w[i], parent_dir, config, swaynag);
+ load_include_config(w[i], config, swaynag);
}
wordfree(&p);
}
Loading…
Cancel
Save