Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 99632 Details for
Bug 151257
eject incorrectly handles mount points with spaces in name
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fixes space handling
eject-space-handling.patch (text/plain), 1.50 KB, created by
Adam Goossens
on 2006-10-13 21:20:41 UTC
(
hide
)
Description:
fixes space handling
Filename:
MIME Type:
Creator:
Adam Goossens
Created:
2006-10-13 21:20:41 UTC
Size:
1.50 KB
patch
obsolete
>--- ../eject/eject.c 2006-02-11 12:24:38.000000000 +1030 >+++ ./eject.c 2006-10-14 13:41:36.000000000 +0930 >@@ -843,6 +843,35 @@ > return 0; > } > >+/* next three functions copied from mntent.c from util-linux*/ >+#define isoctal(a) (((a) & ~7) == '0') >+ >+static int is_space_or_tab (char c) { >+ return (c == ' ' || c == '\t'); >+} >+ >+char* skip_nonspaces(char *s) { >+ while (*s && !is_space_or_tab(*s)) >+ s++; >+ return s; >+} >+ >+static char* unmangle(char *s) { >+ char *ret, *ss, *sp; >+ >+ ss = skip_nonspaces(s); >+ ret = sp = malloc(ss-s+1); >+ /*FIXME: missing error checking*/ >+ while(s != ss) { >+ if (*s == '\\' && isoctal(s[1]) && isoctal(s[2]) && isoctal(s[3])) { >+ *sp++ = 64*(s[1] & 7) + 8*(s[2] & 7) + (s[3] & 7); >+ s += 4; >+ } else >+ *sp++ = *s++; >+ } >+ *sp = 0; >+ return ret; >+} > > /* > * See if device has been mounted by looking in mount table. If so, set >@@ -876,8 +905,8 @@ > if (((strcmp(s1, name) == 0) || (strcmp(s2, name) == 0)) || > ((maj != -1) && (maj == mtabmaj) && (min == mtabmin))) { > FCLOSE(fp); >- *deviceName = strdup(s1); >- *mountName = strdup(s2); >+ *deviceName = unmangle(strdup(s1)); >+ *mountName = unmangle(strdup(s2)); > return 1; > } > } >@@ -920,8 +949,8 @@ > rc = sscanf(line, "%1023s %1023s", s1, s2); > if (rc >= 2 && s1[0] != '#' && strcmp(s2, name) == 0) { > FCLOSE(fp); >- *deviceName = strdup(s1); >- *mountName = strdup(s2); >+ *deviceName = unmangle(strdup(s1)); >+ *mountName = unmangle(strdup(s2)); > return 1; > } > }
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 151257
:
99632
|
99676