Skip to content
Extraits de code Groupes Projets

Comparer les révisions

Les modifications sont affichées comme si la révision source était fusionnée avec la révision cible. En savoir plus sur la comparaison des révisions.

Source

Sélectionner le projet cible
No results found
Sélectionner une révision Git
  • fix-mpris-qtwindow-race-condition
  • fix-qt-deprecated-qvariant-type
  • master
  • rust
  • rust-appimage-wayland
  • rust-playlist-sync
  • windows-build-rebased
  • v1.0
  • v1.1
  • v1.2
  • v1.3
  • v1.4
  • v1.5
  • v1.6
  • v1.7
  • v1.8
  • v1.8-1
  • v1.8-2
  • v1.8-3
  • v2.0
  • v2.1
  • v2.2
  • v2.3
  • v2.3-1
  • v2.4
  • v2.5
26 résultats

Cible

Sélectionner le projet cible
  • martin2018/lektor
1 résultat
Sélectionner une révision Git
  • fix-mpris-qtwindow-race-condition
  • fix-qt-deprecated-qvariant-type
  • master
  • rust
  • rust-appimage-wayland
  • rust-playlist-sync
  • windows-build-rebased
  • v1.0
  • v1.1
  • v1.2
  • v1.3
  • v1.4
  • v1.5
  • v1.6
  • v1.7
  • v1.8
  • v1.8-1
  • v1.8-2
  • v1.8-3
  • v2.0
  • v2.1
  • v2.2
  • v2.3
  • v2.3-1
  • v2.4
  • v2.5
26 résultats
Afficher les modifications
Validations sur la source (2)
......@@ -10,7 +10,7 @@
/* Get the path to the config file that may be red, taking into account the
priority between existing files. The returned path is a path to an existing
file. If no file is found, returns a non zero value. Returns 1 otherwise. */
file. If no file is found, returns a non zero value. Returns 0 otherwise. */
PRIVATE_FUNCTION int config_detect_file(char *conf, size_t conf_len);
/* Create and read the configuration in the conf file and write it into
......@@ -211,7 +211,7 @@ config_default_file(char *dest, size_t len)
} else {
LOG_DEBUG("CONFIG", "Using XDG_CONFIG_HOME: %s", home);
safe_strncpy(dest, home, len - 1);
strncat(dest, "/lektor/lektor.ini", len - 1);
strncat(dest, "/lektor/lektor.ini", len - 1 - strlen(home));
}
}
......@@ -342,9 +342,9 @@ ___mkdir(const char *dir)
int
config_open(lkt_db *db, char *conf_file, size_t conf_len)
{
int retry_config_once = 0;
bool retry_config_once = false;
retry_config:
if (conf_file[0] == '\0' && config_detect_file(conf_file, conf_len)) {
if ((conf_file[0] == '\0') && config_detect_file(conf_file, conf_len)) {
RETURN_IF(retry_config_once, "Failed to find a config file", 1);
LOG_INFO("INIT", "Creating default config file");
......@@ -353,7 +353,7 @@ retry_config:
errno = 0;
FILE *file_desc = fopen(conf_file, "w+");
if (file_desc != NULL) {
if (file_desc == NULL) {
LOG_ERROR("INIT", "Failed to open default config file and initialize it");
LOG_ERROR("INTI", "Conf file is %s, errno is %d: %s", conf_file, errno,
strerror(errno));
......@@ -363,7 +363,7 @@ retry_config:
fclose(file_desc);
LOG_INFO("INIT", "Default configuration file has been writen to %s", conf_file);
retry_config_once = 1;
retry_config_once = true;
goto retry_config;
}
......