]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix readline.c compiler warning. (GH-98738)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 26 Oct 2022 23:28:40 +0000 (16:28 -0700)
committerGitHub <noreply@github.com>
Wed, 26 Oct 2022 23:28:40 +0000 (16:28 -0700)
```
Modules/readline.c:1260:37: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    completer_word_break_characters =
                                    ^
```
(cherry picked from commit 29b391b1378577825a658b14764a8ff3e0b5c958)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
Modules/readline.c

index c79d22f85f84ea3b1b4a5809cf1dc7dcf72168b7..1d5067209072b625ecd20a1f6f47d0f6d7a29d7c 100644 (file)
@@ -1256,9 +1256,9 @@ setup_readline(readlinestate *mod_state)
     rl_attempted_completion_function = flex_complete;
     /* Set Python word break characters */
     completer_word_break_characters =
-        rl_completer_word_break_characters =
         strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
         /* All nonalphanums except '.' */
+    rl_completer_word_break_characters = completer_word_break_characters;
 
     mod_state->begidx = PyLong_FromLong(0L);
     mod_state->endidx = PyLong_FromLong(0L);