simon-git: putty (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Mar 16 17:38:31 GMT 2023


TL;DR:
  9adfa797 split_into_argv: stop using isspace().
  acaa326f Start a windows/test subdirectory.
  10e1ac77 Add a Unicode version of split_into_argv().
  2357dee0 Fix allocations at the start of split_into_argv.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2023-03-16 17:38:31

commit 9adfa797677ba5cc5a5c9db45e593a9e4ab293aa
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=9adfa797677ba5cc5a5c9db45e593a9e4ab293aa;hp=a890ffb15b2371095e6ee9726c9d977ff9f77899
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Mar 15 19:37:26 2023 +0000

    split_into_argv: stop using isspace().
    
    I checked exhaustively today and found that the only characters (even
    in Unicode) that Windows's default argv splitter will recognise as
    word separators are the space and tab characters. So I think it's a
    mistake to use <ctype.h> functions to identify word separators; we
    should use that fixed character pair, and then we know we're getting
    the right ones only.

 windows/utils/split_into_argv.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

commit acaa326fa5f05a2628cf7509c138ef0a7f2ada07
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=acaa326fa5f05a2628cf7509c138ef0a7f2ada07;hp=9adfa797677ba5cc5a5c9db45e593a9e4ab293aa
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Mar 15 07:51:10 2023 +0000

    Start a windows/test subdirectory.
    
    This will contain test code and test subprograms that don't belong in
    the top-level test directory due to not being cross-platform.
    
    Initial contents are test_screenshot.c, which was already its own
    source file in the windows subdir, and test_split_into_argv.c, which
    I've sawn off the bottom of windows/utils/split_into_argv.c and moved
    into its own source file.

 windows/CMakeLists.txt               |   4 +-
 windows/{ => test}/test_screenshot.c |   0
 windows/test/test_split_into_argv.c  | 444 +++++++++++++++++++++++++++++++++++
 windows/utils/split_into_argv.c      | 443 ----------------------------------
 4 files changed, 446 insertions(+), 445 deletions(-)

commit 10e1ac7752de9287bc09a33a8fc96316c94736e3
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=10e1ac7752de9287bc09a33a8fc96316c94736e3;hp=acaa326fa5f05a2628cf7509c138ef0a7f2ada07
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Mar 15 07:54:30 2023 +0000

    Add a Unicode version of split_into_argv().
    
    Created in the simplest way, by parametrising the existing code using
    macros.
    
    Nothing actually uses this yet. I hope to gradually switch
    command-line parsing from 'ANSI' to Unicode strings, but this isn't
    the only preparation needed, so it might yet be a while.

 windows/CMakeLists.txt            |  1 +
 windows/utils/split_into_argv.c   | 32 +++++++++++++++++++++-----------
 windows/utils/split_into_argv_w.c |  6 ++++++
 3 files changed, 28 insertions(+), 11 deletions(-)

commit 2357dee0fead5e436089a8d5d69edb30780397e8
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=2357dee0fead5e436089a8d5d69edb30780397e8;hp=10e1ac7752de9287bc09a33a8fc96316c94736e3
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Mar 15 07:58:05 2023 +0000

    Fix allocations at the start of split_into_argv.
    
    While doing that parametrisation I noticed three strlen calls that
    could obviously be replaced with one - and then I also noticed that
    there were missing parens in an expression that should have
    been (n+1)/2, making it n + 1/2, i.e. just n, due to integer
    arithmetic.
    
    Happily that bug meant we were _over_-allocating rather than under,
    but even so, how embarrassing. Fixed.

 windows/utils/split_into_argv.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)



More information about the tartarus-commits mailing list