Fossil SCM

Simplify a test when looking for the command tail.

danield 2025-01-03 14:28 ssh-signing
Commit e1cbb9968d93b80446b83946964a1786958e77f097544edf73eb791a92b325df
1 file changed +2 -5
+2 -5
--- src/file.c
+++ src/file.c
@@ -564,16 +564,13 @@
564564
*/
565565
const char *command_tail(const char *z){
566566
const char *zTail = z;
567567
char chQuote = 0;
568568
if( !zTail ) return 0;
569
- while( z[0] && (!fossil_isspace(z[0]) ||
570
- chQuote) ){
569
+ while( z[0] && (!fossil_isspace(z[0]) || chQuote) ){
571570
if( z[0]=='"' || z[0]=='\'' ){
572
- if( chQuote && chQuote==z[0] )
573
- chQuote = 0;
574
- else chQuote = z[0];
571
+ chQuote = (chQuote==z[0]) ? 0 : z[0];
575572
}
576573
if( fossil_isdirsep(z[0]) ) zTail = &z[1];
577574
z++;
578575
}
579576
return zTail;
580577
--- src/file.c
+++ src/file.c
@@ -564,16 +564,13 @@
564 */
565 const char *command_tail(const char *z){
566 const char *zTail = z;
567 char chQuote = 0;
568 if( !zTail ) return 0;
569 while( z[0] && (!fossil_isspace(z[0]) ||
570 chQuote) ){
571 if( z[0]=='"' || z[0]=='\'' ){
572 if( chQuote && chQuote==z[0] )
573 chQuote = 0;
574 else chQuote = z[0];
575 }
576 if( fossil_isdirsep(z[0]) ) zTail = &z[1];
577 z++;
578 }
579 return zTail;
580
--- src/file.c
+++ src/file.c
@@ -564,16 +564,13 @@
564 */
565 const char *command_tail(const char *z){
566 const char *zTail = z;
567 char chQuote = 0;
568 if( !zTail ) return 0;
569 while( z[0] && (!fossil_isspace(z[0]) || chQuote) ){
 
570 if( z[0]=='"' || z[0]=='\'' ){
571 chQuote = (chQuote==z[0]) ? 0 : z[0];
 
 
572 }
573 if( fossil_isdirsep(z[0]) ) zTail = &z[1];
574 z++;
575 }
576 return zTail;
577

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button