]> asedeno.scripts.mit.edu Git - PuTTY_svn.git/commitdiff
`ampersat-in-username': tweak `strchr' to `strrchr' where necessary to
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Tue, 21 Sep 2004 16:49:51 +0000 (16:49 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Tue, 21 Sep 2004 16:49:51 +0000 (16:49 +0000)
consistently support usernames containing `@'.

git-svn-id: http://svn.tartarus.org/sgt/putty@4563 cda61777-01e9-0310-a592-d414129be87e

plink.c
psftp.c
scp.c
unix/uxplink.c
window.c

diff --git a/plink.c b/plink.c
index 307d7298841d29f2dc845050d6e01a7e81645ca9..f6e2a70243f0944ec5660038034924df672e256d 100644 (file)
--- a/plink.c
+++ b/plink.c
@@ -484,7 +484,7 @@ int main(int argc, char **argv)
 
     /* See if host is of the form user@host */
     if (cfg.host[0] != '\0') {
-       char *atsign = strchr(cfg.host, '@');
+       char *atsign = strrchr(cfg.host, '@');
        /* Make sure we're not overflowing the user field */
        if (atsign) {
            if (atsign - cfg.host < sizeof cfg.username) {
diff --git a/psftp.c b/psftp.c
index e5374c5f9a18409a9c8a1f99c5d01cef0455f520..ba038b0751df866d5687a3d2c0efae7bbcdb5df9 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -1870,7 +1870,7 @@ static int psftp_connect(char *userhost, char *user, int portnumber)
 
     /* See if host is of the form user@host */
     if (cfg.host[0] != '\0') {
-       char *atsign = strchr(cfg.host, '@');
+       char *atsign = strrchr(cfg.host, '@');
        /* Make sure we're not overflowing the user field */
        if (atsign) {
            if (atsign - cfg.host < sizeof cfg.username) {
diff --git a/scp.c b/scp.c
index fe341be13c57839004e4c465343439056937268d..1c601e979363cc356abc75526c2c0585ba13d9e1 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -370,7 +370,7 @@ static void do_cmd(char *host, char *user, char *cmd)
 
     /* See if host is of the form user@host */
     if (cfg.host[0] != '\0') {
-       char *atsign = strchr(cfg.host, '@');
+       char *atsign = strrchr(cfg.host, '@');
        /* Make sure we're not overflowing the user field */
        if (atsign) {
            if (atsign - cfg.host < sizeof cfg.username) {
index ee446ece2044479b227cb2bfc41555b3ee6fbb3b..d144cb9f41aa52deb1a46a90357baaa75a18de02 100644 (file)
@@ -471,7 +471,7 @@ int main(int argc, char **argv)
 
     /* See if host is of the form user@host */
     if (cfg.host[0] != '\0') {
-       char *atsign = strchr(cfg.host, '@');
+       char *atsign = strrchr(cfg.host, '@');
        /* Make sure we're not overflowing the user field */
        if (atsign) {
            if (atsign - cfg.host < sizeof cfg.username) {
index 762df68adc3b88bb9371b6226ee9edacf2075eb2..39ac38dc4a65fde561f36e404a3a2ae5fc62e5cc 100644 (file)
--- a/window.c
+++ b/window.c
@@ -525,7 +525,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
 
        /* See if host is of the form user@host */
        if (cfg.host[0] != '\0') {
-           char *atsign = strchr(cfg.host, '@');
+           char *atsign = strrchr(cfg.host, '@');
            /* Make sure we're not overflowing the user field */
            if (atsign) {
                if (atsign - cfg.host < sizeof cfg.username) {