modify the routines for checking the extension of filename 2.0alpha master 2.0_alpha submit/master/20120920.150946
authorJin Yoon <jinny.yoon@samsung.com>
Tue, 4 Sep 2012 04:22:25 +0000 (13:22 +0900)
committerJin Yoon <jinny.yoon@samsung.com>
Tue, 4 Sep 2012 04:35:02 +0000 (13:35 +0900)
Change-Id: I0f90f2f9aebf2c7e05ecc5910fee4a3f29bc522b

packaging/menu-daemon.spec
src/pkg_event.c

index 1e373ae..91e0e94 100644 (file)
@@ -6,7 +6,7 @@ Name:       menu-daemon
 Summary:    Menu daemon
 Version:    0.2.43
 Release:    1
-Group:      TO_BE/FILLED_IN
+Group:      apps
 License:    Flora Software License
 Source0:    menu-daemon-%{version}.tar.gz
 BuildRequires:  pkgconfig(ail)
@@ -39,7 +39,7 @@ menu-daemon (Grab H/W key, Package manifest file parsing)
 %setup -q
 
 %build
-export LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--hash-style=both -Wl,--as-needed"
+export LDFLAGS+="-Wl,--hash-style=both -Wl,--as-needed"
 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
 make %{?jobs:-j%jobs}
 
index 51f5cb6..93fed03 100644 (file)
@@ -93,7 +93,6 @@ directory_notify(void* data, Ecore_Fd_Handler* fd_handler)
        while (i < len) {
                struct inotify_event* event = (struct inotify_event*) &buf[i];
                char *str_potksed = "potksed.";
-               char *cut;
                char *package = NULL;
                ssize_t idx;
                int nev_name;
@@ -107,15 +106,16 @@ directory_notify(void* data, Ecore_Fd_Handler* fd_handler)
                        nev_name --;
                }
 
-               if (str_potksed[idx] != '\0') {
+               if (str_potksed[idx] != '\0' || nev_name < 0) {
                        _D("This is not a desktop file : %s", event->name);
                        i += sizeof(struct inotify_event) + event->len;
                        continue;
                }
 
                package = strdup(event->name);
-               cut = strstr(package, ".desktop");
-               *cut = '\0';
+               break_if(NULL == package);
+
+               package[nev_name + 1] = '\0';
                _D("Package : %s", package);
 
                // add & update