[x264-devel] [Git][videolan/x264][master] cli: Use space instead of newline as autocomplete delimiter

Anton Mitrofanov (@BugMaster) gitlab at videolan.org
Sat Oct 1 18:35:29 UTC 2022



Anton Mitrofanov pushed to branch master at VideoLAN / x264


Commits:
ed0f7a63 by Henrik Gramner at 2022-10-01T17:21:11+02:00
cli: Use space instead of newline as autocomplete delimiter

On most systems any whitespace is fine, but MSYS2 wants ASCII 0x20.

- - - - -


1 changed file:

- autocomplete.c


Changes:

=====================================
autocomplete.c
=====================================
@@ -240,7 +240,7 @@ static int list_contains( const char * const *list, const char *s )
 static void suggest( const char *s, const char *cur, int cur_len )
 {
     if( s && *s && !strncmp( s, cur, cur_len ) )
-        printf( "%s\n", s );
+        printf( "%s ", s );
 }
 
 static void suggest_lower( const char *s, const char *cur, int cur_len )
@@ -249,7 +249,7 @@ static void suggest_lower( const char *s, const char *cur, int cur_len )
     {
         for( ; *s; s++ )
             putchar( *s < 'A' || *s > 'Z' ? *s : *s | 0x20 );
-        putchar( '\n' );
+        putchar( ' ' );
     }
 }
 
@@ -273,7 +273,7 @@ static void suggest_token( const char *s, int delim, const char *cur, int cur_le
         {
             int tok_len = tok_end - s;
             if( tok_len && tok_len >= cur_len && !strncmp( s, cur, cur_len ) )
-                printf( "%.*s\n", tok_len, s );
+                printf( "%.*s ", tok_len, s );
         }
         suggest( s, cur, cur_len );
     }
@@ -403,5 +403,6 @@ int x264_cli_autocomplete( const char *prev, const char *cur )
             suggest_list( opts_special );
     }
 
+    putchar( '\n' );
     return 0;
 }



View it on GitLab: https://code.videolan.org/videolan/x264/-/commit/ed0f7a634050a62c1da27c99eea710824d4c3705

-- 
View it on GitLab: https://code.videolan.org/videolan/x264/-/commit/ed0f7a634050a62c1da27c99eea710824d4c3705
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the x264-devel mailing list