Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121186
b: refs/heads/master
c: 74e2f33
h: refs/heads/master
v: v3
  • Loading branch information
Török Edwin authored and Ingo Molnar committed Nov 23, 2008
1 parent 5e8555c commit fb9657b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 02b67518e2b1c490787dac7f35e1204e74fe21ba
refs/heads/master: 74e2f334f4440cbcb63e9ebbcdcea430d41bdfa3
14 changes: 13 additions & 1 deletion trunk/fs/seq_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,18 @@ int seq_printf(struct seq_file *m, const char *f, ...)
}
EXPORT_SYMBOL(seq_printf);

static char *mangle_path(char *s, char *p, char *esc)
/**
* mangle_path - mangle and copy path to buffer beginning
* @s - buffer start
* @p - beginning of path in above buffer
* @esc - set of characters that need escaping
*
* Copy the path from @p to @s, replacing each occurrence of character from
* @esc with usual octal escape.
* Returns pointer past last written character in @s, or NULL in case of
* failure.
*/
char *mangle_path(char *s, char *p, char *esc)
{
while (s <= p) {
char c = *p++;
Expand All @@ -376,6 +387,7 @@ static char *mangle_path(char *s, char *p, char *esc)
}
return NULL;
}
EXPORT_SYMBOL_GPL(mangle_path);

/*
* return the absolute path of 'dentry' residing in mount 'mnt'.
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/seq_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct seq_operations {

#define SEQ_SKIP 1

char *mangle_path(char *s, char *p, char *esc);
int seq_open(struct file *, const struct seq_operations *);
ssize_t seq_read(struct file *, char __user *, size_t, loff_t *);
loff_t seq_lseek(struct file *, loff_t, int);
Expand Down

0 comments on commit fb9657b

Please sign in to comment.