You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, I'm facing a strange issue where the generated patch is created exactly how I'd expect it to.
The issue is that there will usually be an accompanying unmatched parenthesis.
To give you an idea of what I'm talking about, I'm working with the iotop-c package as an example.
Patch to generate the upstream
diff --git a/src/configfile.c b/../../../upstreams/iotop/src/configfile.c
index e91f1ea..1b5ed82 100644
--- a/src/configfile.c+++ b/../../../upstreams/iotop/src/configfile.c@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2014 Vyacheslav Trushkin
-Copyright (C) 2020-2023 Boian Bonev+Copyright (C) 2020-2024 Boian Bonev
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
@@ -20,7 +20,8 @@ You should have received a copy of the GNU General Public License along with thi
#include <sys/stat.h>
#include <sys/types.h>
-#define CONFIG_PATH "/.config/iotop"+#define CONFIG_DIR1 "/.config"+#define CONFIG_DIR2 "/iotop"
#define CONFIG_NAME "/iotoprc"
#define MAX_OPT 50
@@ -48,15 +49,25 @@ static inline void mkdir_p(const char *dir) {
static inline FILE *config_file_open(const char *mode) {
char path[PATH_MAX];
+ char *xdgconfig;
char *home;
+ xdgconfig=getenv("XDG_CONFIG_HOME");
home=getenv("HOME");
- if (!home)- home="";- strcpy(path,home);- strcat(path,CONFIG_PATH);- mkdir_p(path);+ if (xdgconfig) {+ strcpy(path,xdgconfig);+ strcat(path,CONFIG_DIR2);+ mkdir_p(path);+ } else {+ if (home)+ strcpy(path,home);+ else+ strcpy(path,"");+ strcat(path,CONFIG_DIR1);+ strcat(path,CONFIG_DIR2);+ mkdir_p(path);+ }
strcat(path,CONFIG_NAME);
return fopen(path,mode);
@@ -247,6 +258,9 @@ inline int config_file_save(void) {
// --ascii
if (!config.f.unicode)
fprintf(cf,"--ascii\n");
+ // --hide-time+ if (config.f.hideclock)+ fprintf(cf,"--hide-time\n");
fclose(cf);
(this is part of a larger patch, which I've omitted here for readability)
Hi all, I'm facing a strange issue where the generated patch is created exactly how I'd expect it to.
The issue is that there will usually be an accompanying unmatched parenthesis.
To give you an idea of what I'm talking about, I'm working with the iotop-c package as an example.
Patch to generate the upstream
(this is part of a larger patch, which I've omitted here for readability)
Upstream patch to backport:
Generated Backport Patch:
As you can see in this example, there are additional
)
characters being added to the function backport where there shouldn't be.Otherwise, the patch performs as expected.
The text was updated successfully, but these errors were encountered: