Bug 10770

Summary: parser lib error when generating xorg.conf file
Product: xorg Reporter: Patrick Filion <patrick.filion1>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: minor    
Priority: low    
Version: 7.2 (2007.02)   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Patrick Filion 2007-04-26 07:27:02 UTC
Hi,
I've found a minor problem in the xserver parser library (./hw/xfree86/parser/)

The Files.c contains an error which causes the InputDevices section not being printed out to file proprely.  The last "InputDevices" is always printed out as Inputdevs instead of InputDevices.  So using this library generated an error in the config file using a wrong keyword ( probably an old one )

Output example :

        many other InputDevices ...
	InputDevices   "/dev/input/event0"
	InputDevices   "/dev/pointer0"
	InputDevices   "/dev/pointer1"
	InputDevices   "/dev/pointer2"
==>	Inputdevs   "/dev/pointer3"
        FontPath     "/usr/X11R6/lib/X11/fonts/misc:unscaled"
        etc ...

Here's the code :

Files.c:248
void
xf86printFileSection (FILE * cf, XF86ConfFilesPtr ptr)

in function : 

if (ptr->file_inputdevs)
	{
		s = ptr->file_inputdevs;
		p = index (s, ',');
		while (p)
		{
			*p = '\000';
			fprintf (cf, "\tInputDevices   \"%s\"\n", s);
			*p = ',';
			s = p;
			s++;
			p = index (s, ',');
		}
===>		fprintf (cf, "\tInputdevs   \"%s\"\n", s);
	}

Solution :
You can fix it by changing Inputdevs to InputDevices after the while loop. (Line 261)

As I said, it's a small bug. I found it, why not report it ...
Comment 1 Adam Jackson 2007-06-28 13:47:30 UTC
Fixed in head, thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.