aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/user.c
diff options
context:
space:
mode:
authorJames Bursa <james@zamez.org>2007-01-05 19:36:28 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2007-01-06 02:55:22 -0500
commit3223ea8cca5936b8e78450dd5b8ba88372e9c0a8 (patch)
tree3b84970d50f9d2408a09cfcfdf886c7db905b314 /kernel/power/user.c
parent6c5f8cc33eb2e10b6ab788bbe259fc142a068627 (diff)
[PATCH] adfs: fix filename handling
Fix filenames on adfs discs being terminated at the first character greater than 128 (adfs filenames are Latin 1). I saw this problem when using a loopback adfs image on a 2.6.17-rc5 x86_64 machine, and the patch fixed it there. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/power/user.c')
0 files changed, 0 insertions, 0 deletions
9-18 15:49:27 -0400 committer Sam Ravnborg <sam@ravnborg.org> 2009-09-20 06:27:43 -0400 checkincludes.pl: add option to remove duplicates in place' href='/cgit/cgit.cgi/litmus-rt.git/commit/scripts/checkincludes.pl?h=wip-shared-lib2&id=92f3f19c519d2eb18812a38312b05075cf0407db'>92f3f19c519d
f9d490ab3742
92f3f19c519d











f9d490ab3742

1da177e4c3f4



92f3f19c519d
1da177e4c3f4




92f3f19c519d
1da177e4c3f4
d9a7a2bd07ed

92f3f19c519d





1da177e4c3f4
92f3f19c519d
1da177e4c3f4
92f3f19c519d























1da177e4c3f4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

               

                                                          
                                                                        






                                                                
 
           


                                                                


               

               
                 











                                       

 



                                                            
                            




                                                          
                                      
         

                    





                                                                                       
                 
                     
         























                                                                            
 
#!/usr/bin/perl
#
# checkincludes: find/remove files included more than once
#
# Copyright abandoned, 2000, Niels Kristian Bech Jensen <nkbj@image.dk>.
# Copyright 2009 Luis R. Rodriguez <mcgrof@gmail.com>
#
# This script checks for duplicate includes. It also has support
# to remove them in place. Note that this will not take into
# consideration macros so you should run this only if you know
# you do have real dups and do not have them under #ifdef's. You
# could also just review the results.

sub usage {
	print "Usage: checkincludes.pl [-r]\n";
	print "By default we just warn of duplicates\n";
	print "To remove duplicated includes in place use -r\n";
	exit 1;
}

my $remove = 0;

if ($#ARGV < 0) {
	usage();
}

if ($#ARGV >= 1) {
	if ($ARGV[0] =~ /^-/) {
		if ($ARGV[0] eq "-r") {
			$remove = 1;
			shift;
		} else {
			usage();
		}
	}
}

foreach $file (@ARGV) {
	open(FILE, $file) or die "Cannot open $file: $!.\n";

	my %includedfiles = ();
	my @file_lines = ();

	while (<FILE>) {
		if (m/^\s*#\s*include\s*[<"](\S*)[>"]/o) {
			++$includedfiles{$1};
		}
		push(@file_lines, $_);
	}

	close(FILE);

	if (!$remove) {
		foreach $filename (keys %includedfiles) {
			if ($includedfiles{$filename} > 1) {
				print "$file: $filename is included more than once.\n";
			}
		}
		next;
	}

	open(FILE,">$file") || die("Cannot write to $file: $!");

	my $dups = 0;
	foreach (@file_lines) {
		if (m/^\s*#\s*include\s*[<"](\S*)[>"]/o) {
			foreach $filename (keys %includedfiles) {
				if ($1 eq $filename) {
					if ($includedfiles{$filename} > 1) {
						$includedfiles{$filename}--;
						$dups++;
					} else {
						print FILE $_;
					}
				}
			}
		} else {
			print FILE $_;
		}
	}
	if ($dups > 0) {
		print "$file: removed $dups duplicate includes\n";
	}
	close(FILE);
}