summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2009-12-17 16:03:34 -0500
committerSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2009-12-17 16:03:34 -0500
commitce4d17091290ddadf21275077f4158b222b4e426 (patch)
tree4000e75141519f926f49bd3a47af4e5547ae9a1e
parent8b2b63cebef17c8b2ba8a9e05e63a1b806578ec0 (diff)
downloadscreen-ce4d17091290ddadf21275077f4158b222b4e426.tar.gz
Allow attaching to a session whose name starts with digits.
Fixes debian bug#549272.
-rw-r--r--src/socket.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/socket.c b/src/socket.c
index 7832832..68a4258 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -181,8 +181,21 @@ char *match;
if (strncmp(match, "tty", 3) && strncmp(n, "tty", 3) == 0)
n += 3;
if (strncmp(match, n, matchlen))
- continue;
- cmatch = (*(n + matchlen) == 0);
+ {
+ if (n == name && *match > '0' && *match <= '9')
+ {
+ while (*n >= '0' && *n <= '9')
+ n++;
+ if (*n == '.')
+ n++;
+ if (strncmp(match, n, matchlen))
+ continue;
+ }
+ else
+ continue;
+ }
+ else
+ cmatch = (*(n + matchlen) == 0);
debug1(" -> matched %s\n", match);
}
sprintf(SockPath + sdirlen, "/%s", name);