Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 26708 Details for
Bug 38232
Quoted expressions in Xservers confuses xdm
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch (for both 430 and 4399
4152_all_4.3.0-allow-xdm-server-quotes.patch (text/plain), 1.55 KB, created by
Andrew Bevitt
on 2004-03-02 04:30:52 UTC
(
hide
)
Description:
Patch (for both 430 and 4399
Filename:
MIME Type:
Creator:
Andrew Bevitt
Created:
2004-03-02 04:30:52 UTC
Size:
1.55 KB
patch
obsolete
>--- xc/programs/xdm/file.c.old 2004-02-17 22:55:03.000000000 +1100 >+++ xc/programs/xdm/file.c 2004-03-02 23:23:42.243627680 +1100 >@@ -39,6 +39,7 @@ > # include "dm_error.h" > > # include <ctype.h> >+# include <stdbool.h> > > static int > DisplayTypeMatch (DisplayType d1, DisplayType d2) >@@ -62,11 +63,14 @@ > splitIntoWords (char *s) > { > char **args, **newargs; >- char *wordStart; >+ char *wordStart, *thisToken; > int nargs; >- >+ bool spaceBreakable, hadQuotes; >+ static char DOUBLE_QUOTE=34, SINGLE_QUOTE=39; >+ > args = 0; > nargs = 0; >+ spaceBreakable = true; > while (*s) > { > while (*s && isspace (*s)) >@@ -74,8 +78,17 @@ > if (!*s || *s == '#') > break; > wordStart = s; >- while (*s && *s != '#' && !isspace (*s)) >+ hadQuotes = false; >+ while (*s && *s != '#') >+ { >+ if (spaceBreakable && isspace (*s)) >+ break; >+ if (*s == DOUBLE_QUOTE || *s == SINGLE_QUOTE){ >+ spaceBreakable = !spaceBreakable; >+ hadQuotes = true; >+ } > ++s; >+ } > if (!args) > { > args = (char **) malloc (2 * sizeof (char *)); >@@ -93,14 +106,25 @@ > } > args = newargs; > } >- args[nargs] = malloc (s - wordStart + 1); >+ >+ args[nargs] = malloc (s - wordStart); >+ > if (!args[nargs]) > { > freeFileArgs (args); > return NULL; > } >+ > strncpy (args[nargs], wordStart, s - wordStart); >+ > args[nargs][s-wordStart] = '\0'; >+ >+ /* Tidy up problems with quotes in file */ >+ if (hadQuotes){ >+ args[nargs][0] = ' '; >+ args[nargs][s-wordStart-1] = ' '; >+ } >+ > ++nargs; > args[nargs] = NULL; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 38232
: 26708