Fossil SCM

Handle missing port more gracefully. Allows for SCP style URL.

amb 2013-07-17 14:23 ssh-transport-changes
Commit f15adbba0e6235db17e17b0f82e3bbed3be7c927
2 files changed +1 -1 +1 -1
--- src/http_transport.c
+++ src/http_transport.c
@@ -112,11 +112,11 @@
112112
char *zHost; /* The host name to contact */
113113
int n; /* Size of prefix string */
114114
115115
zSsh = db_get("ssh-command", zDefaultSshCmd);
116116
blob_init(&zCmd, zSsh, -1);
117
- if( g.urlPort!=g.urlDfltPort ){
117
+ if( g.urlPort!=g.urlDfltPort && g.urlPort ){
118118
#ifdef __MINGW32__
119119
blob_appendf(&zCmd, " -P %d", g.urlPort);
120120
#else
121121
blob_appendf(&zCmd, " -p %d", g.urlPort);
122122
#endif
123123
--- src/http_transport.c
+++ src/http_transport.c
@@ -112,11 +112,11 @@
112 char *zHost; /* The host name to contact */
113 int n; /* Size of prefix string */
114
115 zSsh = db_get("ssh-command", zDefaultSshCmd);
116 blob_init(&zCmd, zSsh, -1);
117 if( g.urlPort!=g.urlDfltPort ){
118 #ifdef __MINGW32__
119 blob_appendf(&zCmd, " -P %d", g.urlPort);
120 #else
121 blob_appendf(&zCmd, " -p %d", g.urlPort);
122 #endif
123
--- src/http_transport.c
+++ src/http_transport.c
@@ -112,11 +112,11 @@
112 char *zHost; /* The host name to contact */
113 int n; /* Size of prefix string */
114
115 zSsh = db_get("ssh-command", zDefaultSshCmd);
116 blob_init(&zCmd, zSsh, -1);
117 if( g.urlPort!=g.urlDfltPort && g.urlPort ){
118 #ifdef __MINGW32__
119 blob_appendf(&zCmd, " -P %d", g.urlPort);
120 #else
121 blob_appendf(&zCmd, " -p %d", g.urlPort);
122 #endif
123
+1 -1
--- src/url.c
+++ src/url.c
@@ -162,11 +162,11 @@
162162
g.urlCanonical = mprintf(
163163
"%s://%s%T:%d%T",
164164
g.urlProtocol, zLogin, g.urlName, g.urlPort, g.urlPath
165165
);
166166
}
167
- if( g.urlIsSsh && g.urlPath[1] ) g.urlPath++;
167
+ if( g.urlIsSsh && g.urlPath[1] && g.urlPort ) g.urlPath++;
168168
free(zLogin);
169169
}else if( strncmp(zUrl, "file:", 5)==0 ){
170170
g.urlIsFile = 1;
171171
if( zUrl[5]=='/' && zUrl[6]=='/' ){
172172
i = 7;
173173
--- src/url.c
+++ src/url.c
@@ -162,11 +162,11 @@
162 g.urlCanonical = mprintf(
163 "%s://%s%T:%d%T",
164 g.urlProtocol, zLogin, g.urlName, g.urlPort, g.urlPath
165 );
166 }
167 if( g.urlIsSsh && g.urlPath[1] ) g.urlPath++;
168 free(zLogin);
169 }else if( strncmp(zUrl, "file:", 5)==0 ){
170 g.urlIsFile = 1;
171 if( zUrl[5]=='/' && zUrl[6]=='/' ){
172 i = 7;
173
--- src/url.c
+++ src/url.c
@@ -162,11 +162,11 @@
162 g.urlCanonical = mprintf(
163 "%s://%s%T:%d%T",
164 g.urlProtocol, zLogin, g.urlName, g.urlPort, g.urlPath
165 );
166 }
167 if( g.urlIsSsh && g.urlPath[1] && g.urlPort ) g.urlPath++;
168 free(zLogin);
169 }else if( strncmp(zUrl, "file:", 5)==0 ){
170 g.urlIsFile = 1;
171 if( zUrl[5]=='/' && zUrl[6]=='/' ){
172 i = 7;
173

Keyboard Shortcuts

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